[Glitch] Convert notification requests actions and reducers to Typescript

Port c0eda832f3 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Claire committed 2024-09-16 21:28:05 +02:00
1 parent 665e9129fe
commit e25634ccef
13 files changed
+590 -497

No files matched your search

@@ -0,0 +1,19 @@
import type { ApiNotificationRequestJSON } from 'flavours/glitch/api_types/notifications';
export interface NotificationRequest
extends Omit<ApiNotificationRequestJSON, 'account' | 'notifications_count'> {
account_id: string;
notifications_count: number;
}
export function createNotificationRequestFromJSON(
requestJSON: ApiNotificationRequestJSON,
): NotificationRequest {
const { account, notifications_count, ...request } = requestJSON;
return {
account_id: account.id,
notifications_count: +notifications_count,
...request,
};
}