Skip to content

Commit 95ed3be

Browse files
committed
Fix
1 parent 814dffe commit 95ed3be

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

frontend/src/store/reducers/prescriptionsSlice.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export const PrescriptionFilters = z.object({
1818
kinds: z.array(ProgrammingPlanKind).nullish(),
1919
context: ProgrammingPlanContext.nullish(),
2020
matrixQuery: z.string().nullish(),
21-
missingSlaughterhouse: z.boolean().default(false),
22-
missingLaboratory: z.boolean().default(false)
21+
missingSlaughterhouse: z.boolean().nullish(),
22+
missingLaboratory: z.boolean().nullish()
2323
});
2424

2525
export type PrescriptionFilters = z.infer<typeof PrescriptionFilters>;

frontend/src/views/ProgrammingView/ProgrammingPrescriptionList/ProgrammingPrescriptionListHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ const ProgrammingPrescriptionListHeader = ({
170170
<ToggleSwitch
171171
label={<span className="no-wrap">Abattoir à attribuer</span>}
172172
inputTitle="Filtrer les prélèvements avec abattoir à attribuer"
173-
checked={prescriptionFilters.missingSlaughterhouse}
173+
checked={prescriptionFilters.missingSlaughterhouse ?? false}
174174
onChange={(checked) => {
175175
dispatch(
176176
prescriptionsSlice.actions.changePrescriptionFilters({
@@ -190,7 +190,7 @@ const ProgrammingPrescriptionListHeader = ({
190190
<span className="no-wrap">Laboratoire à attribuer</span>
191191
}
192192
inputTitle="Filtrer les prélèvements avec laboratoire à attribuer"
193-
checked={prescriptionFilters.missingLaboratory}
193+
checked={prescriptionFilters.missingLaboratory ?? false}
194194
onChange={(checked) => {
195195
dispatch(
196196
prescriptionsSlice.actions.changePrescriptionFilters({

shared/utils/utils.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import {
77
flow,
88
isArray,
99
isDate,
10-
isEqual,
11-
isPlainObject,
12-
pick
10+
isPlainObject
1311
} from 'lodash-es';
1412
import { z } from 'zod';
1513

@@ -87,7 +85,3 @@ export const formatWithTz = (date: Date, formatStr: string) =>
8785
format(toZonedTime(date, 'Europe/Paris'), formatStr, {
8886
locale: fr
8987
});
90-
91-
export function isEqualOnKeys<T>(obj1: T, obj2: T, keys: (keyof T)[]): boolean {
92-
return isEqual(pick(obj1, keys), pick(obj2, keys));
93-
}

0 commit comments

Comments
 (0)