Skip to content

Commit a6b972d

Browse files
committed
Updated dependencies and migrated
- 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
1 parent 6caf89f commit a6b972d

File tree

6 files changed

+2276
-1551
lines changed

6 files changed

+2276
-1551
lines changed

components/risk-assessment/RiskAssessmentEntry/ExposureRisksInputs.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,18 @@ const ExposureRisksInputs = (props: ExposureRisksInputsProps) => {
3939
control: control,
4040
})
4141

42-
const { data: sdses, error: sdsError } = useSWR<SdsWithRelations[]>(
43-
!sdsIds ? null : [sdsIds.map((id) => `/api/sds/${id}`)],
42+
const {
43+
data: sdses,
44+
error: sdsError,
45+
isLoading,
46+
} = useSWR<SdsWithRelations[]>(
47+
!sdsIds ? null : sdsIds.map((id) => `/api/sds/${id}`),
4448
)
4549

50+
if (sdsError) {
51+
console.error(sdsError)
52+
}
53+
4654
const getHazardCategoriesByClasses = (...classNames: string[]) => {
4755
if (sdses === undefined) {
4856
return

components/risk-assessment/RiskAssessmentEntry/RationaleList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const RationaleList = ({
5454
const { data: safetyDatasheets, error: sdsesError } = useSWR<
5555
SdsWithRelations[],
5656
JsonError
57-
>(sdsUrls.length > 0 ? [sdsUrls] : null)
57+
>(sdsUrls.length > 0 ? sdsUrls : null)
5858

5959
if (sdsesError) {
6060
console.log(sdsesError)

components/ui/forms/BooleanRadioGroup.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ export const RhfBooleanRadioGroup = <TFieldValues extends FieldValues>(
3838
} = props
3939

4040
let customValidate:
41-
| Validate<PathValue<TFieldValues, Path<TFieldValues>>>
42-
| Record<string, Validate<PathValue<TFieldValues, Path<TFieldValues>>>>
41+
| Validate<PathValue<TFieldValues, Path<TFieldValues>>, TFieldValues>
42+
| Record<
43+
string,
44+
Validate<PathValue<TFieldValues, Path<TFieldValues>>, TFieldValues>
45+
>
4346
| undefined
4447

4548
// If rules.required is true, then create custom validate function for workaround

0 commit comments

Comments
 (0)