1
0
mirror of https://github.com/funamitech/mastodon synced 2024-12-17 08:09:25 +09:00
YuruToot/app/javascript/flavours/glitch/models/notification_request.ts

20 lines
562 B
TypeScript
Raw Normal View History

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,
};
}