Skip to content

Commit 562e371

Browse files
committed
fix ts
Signed-off-by: Abdelsalem <[email protected]>
1 parent 58234b5 commit 562e371

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/pages/banners/add-announcement-form.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const AddAnnouncementForm: FunctionComponent<AddAnnouncementProps> = ({ onAnnoun
9898
{...register('startDate')}
9999
name={START_DATE}
100100
label={intl.formatMessage({ id: 'banners.table.startDate' })}
101-
onChange={(newValue) => setValue('startDate', newValue)}
101+
onChange={(newValue) => setValue('startDate', newValue?.toString)}
102102
/>
103103
</LocalizationProvider>
104104
</Grid>
@@ -108,7 +108,7 @@ const AddAnnouncementForm: FunctionComponent<AddAnnouncementProps> = ({ onAnnoun
108108
{...register('endDate')}
109109
name={END_DATE}
110110
label={intl.formatMessage({ id: 'banners.table.endDate' })}
111-
onChange={(newValue) => setValue('endDate', newValue)}
111+
onChange={(newValue) => setValue('endDate', newValue?.toString)}
112112
/>
113113
</LocalizationProvider>
114114
</Grid>

src/pages/banners/announcements-page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const AnnouncementsPage: FunctionComponent = () => {
7272
);
7373

7474
const refreshGrid = useCallback(() => {
75-
gridRef.current.context?.refresh();
75+
gridRef.current?.context?.refresh();
7676
}, []);
7777

7878
const handleDeleteAnnouncement = useCallback(

src/services/user-admin.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,13 @@ export function fetchAnnouncementList(): Promise<Announcement[]> {
328328
return backendFetchJson(`${USER_ADMIN_URL}/announcements`, { method: 'get' }).catch((reason) => {
329329
console.error(`Error while fetching announcement : ${reason}`);
330330
throw reason;
331-
});
331+
}) as Promise<Announcement[]>;
332332
}
333333

334334
export function deleteAnnouncement(announcementId: UUID): Promise<void> {
335335
console.debug(`Deleting announcement ...`);
336336
return backendFetch(`${USER_ADMIN_URL}/announcements/${announcementId}`, { method: 'delete' }).catch((reason) => {
337337
console.error(`Error while deleting announcement : ${reason}`);
338338
throw reason;
339-
});
339+
}) as Promise<void>;
340340
}

0 commit comments

Comments
 (0)