Skip to content

Commit

Permalink
Updated dependencies and migrated
Browse files Browse the repository at this point in the history
 - kept [email protected] due to import-js/eslint-plugin-import#2682
 - kept [email protected] due to bug with return types in fields/settings.ts
 - kept [email protected] due to issue with Merge type
  • Loading branch information
mmtandoc committed Feb 15, 2023
1 parent 6caf89f commit a6b972d
Show file tree
Hide file tree
Showing 6 changed files with 2,276 additions and 1,551 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,18 @@ const ExposureRisksInputs = (props: ExposureRisksInputsProps) => {
control: control,
})

const { data: sdses, error: sdsError } = useSWR<SdsWithRelations[]>(
!sdsIds ? null : [sdsIds.map((id) => `/api/sds/${id}`)],
const {
data: sdses,
error: sdsError,
isLoading,
} = useSWR<SdsWithRelations[]>(
!sdsIds ? null : sdsIds.map((id) => `/api/sds/${id}`),
)

if (sdsError) {
console.error(sdsError)
}

const getHazardCategoriesByClasses = (...classNames: string[]) => {
if (sdses === undefined) {
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const RationaleList = ({
const { data: safetyDatasheets, error: sdsesError } = useSWR<
SdsWithRelations[],
JsonError
>(sdsUrls.length > 0 ? [sdsUrls] : null)
>(sdsUrls.length > 0 ? sdsUrls : null)

if (sdsesError) {
console.log(sdsesError)
Expand Down
7 changes: 5 additions & 2 deletions components/ui/forms/BooleanRadioGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ export const RhfBooleanRadioGroup = <TFieldValues extends FieldValues>(
} = props

let customValidate:
| Validate<PathValue<TFieldValues, Path<TFieldValues>>>
| Record<string, Validate<PathValue<TFieldValues, Path<TFieldValues>>>>
| Validate<PathValue<TFieldValues, Path<TFieldValues>>, TFieldValues>
| Record<
string,
Validate<PathValue<TFieldValues, Path<TFieldValues>>, TFieldValues>
>
| undefined

// If rules.required is true, then create custom validate function for workaround
Expand Down
Loading

0 comments on commit a6b972d

Please sign in to comment.