You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
555 B
19 lines
555 B
import type { ApiNotificationRequestJSON } from 'mastodon/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, |
|
}; |
|
}
|
|
|