mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-25 23:41:37 +01:00
e25634ccef
Port c0eda832f3
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
19 lines
562 B
TypeScript
19 lines
562 B
TypeScript
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,
|
|
};
|
|
}
|