Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
alpaca-tc committed Jun 17, 2024
1 parent 41b2091 commit 16a3bab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions frontend/repositories/combinedDefinitionRepository.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import useSWR from 'swr'

import { path } from '@/constants/path'
import { CombinedDefinition, CombinedDefinitionGraphOptions, DotMetadata } from '@/models/combinedDefinition'
import { CombinedDefinition, CombinedDefinitionOptions, DotMetadata } from '@/models/combinedDefinition'
import { bitIdToIds } from '@/utils/bitId'
import { stringify } from '@/utils/queryString'

Expand Down Expand Up @@ -112,7 +112,7 @@ export const fetchCombinedDefinition = async (requestPath: string): Promise<Comb
}
}

export const stringifyCombinedDefinitionOptions = (graphOptions: CombinedDefinitionGraphOptions): string => {
export const stringifyCombinedDefinitionOptions = (graphOptions: CombinedDefinitionOptions): string => {
const params = {
compound: graphOptions.compound,
concentrate: graphOptions.concentrate,
Expand All @@ -122,7 +122,7 @@ export const stringifyCombinedDefinitionOptions = (graphOptions: CombinedDefinit
return stringify(params)
}

export const useCombinedDefinition = (ids: number[], graphOptions: CombinedDefinitionGraphOptions) => {
export const useCombinedDefinition = (ids: number[], graphOptions: CombinedDefinitionOptions) => {
const requestPath = `${path.api.definitions.show(ids)}?${stringifyCombinedDefinitionOptions(graphOptions)}`
const shouldFetch = ids.length > 0
const { data, isLoading, mutate } = useSWR(shouldFetch ? requestPath : null, fetchCombinedDefinition)
Expand Down
4 changes: 2 additions & 2 deletions frontend/repositories/moduleDefinitionRepository.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { path } from '@/constants/path'
import { CombinedDefinitionGraphOptions } from '@/models/combinedDefinition'
import { CombinedDefinitionOptions } from '@/models/combinedDefinition'
import { fetchCombinedDefinition, stringifyCombinedDefinitionOptions } from './combinedDefinitionRepository'
import useSWR from 'swr'

export const useModuleDefinition = (moduleNames: string[], graphOptions: CombinedDefinitionGraphOptions) => {
export const useModuleDefinition = (moduleNames: string[], graphOptions: CombinedDefinitionOptions) => {
const requestPath = `${path.api.moduleDefinitions.show(moduleNames)}?${stringifyCombinedDefinitionOptions(graphOptions)}`
const shouldFetch = moduleNames.length > 0
const { data, isLoading, mutate } = useSWR(shouldFetch ? requestPath : null, fetchCombinedDefinition)
Expand Down
4 changes: 2 additions & 2 deletions frontend/utils/queryString/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ const normalizeParams = (params: Record<string, any>, name: string, v: any, dept

let k: string
let after: string
let start: string
let start: number

if (!name) {
// nil name, treat same as empty string (required by tests)
k = after = ''
} else if (depth === 0) {
// Start of parsing, don't treat [] or [ at start of string specially
const start = name.indexOf('[', 1)
start = name.indexOf('[', 1)
if (start !== -1) {
// Start of parameter nesting, use part before brackets as key
k = name.slice(0, start)
Expand Down

0 comments on commit 16a3bab

Please sign in to comment.