Skip to content

Commit 2f7cc0f

Browse files
committed
remove useless code
Signed-off-by: Abdelsalem <[email protected]>
1 parent f2319fd commit 2f7cc0f

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

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

Lines changed: 2 additions & 2 deletions
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?.toString ?? '')}
101+
onChange={(newValue) => setValue('startDate', newValue)}
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?.toString ?? '')}
111+
onChange={(newValue) => setValue('endDate', newValue)}
112112
/>
113113
</LocalizationProvider>
114114
</Grid>

src/services/user-admin.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,10 @@ export function fetchAnnouncementList(): Promise<Announcement[]> {
333333

334334
export function deleteAnnouncement(announcementId: UUID): Promise<void> {
335335
console.debug(`Deleting announcement ...`);
336-
return backendFetch(`${USER_ADMIN_URL}/announcements/${announcementId}`, { method: 'delete' }).catch((reason) => {
337-
console.error(`Error while deleting announcement : ${reason}`);
338-
throw reason;
339-
})
336+
return backendFetch(`${USER_ADMIN_URL}/announcements/${announcementId}`, { method: 'delete' })
340337
.then(() => undefined)
341338
.catch((reason) => {
342-
console.error(`Error while creating announcement : ${reason}`);
339+
console.error(`Error while deleting announcement : ${reason}`);
343340
throw reason;
344341
});
345342
}

0 commit comments

Comments
 (0)