mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 08:48:53 +00:00
[Glitch] Change grouped notifications API shape (take 2)
Port front-end changes from 549ab089ee to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -14,7 +14,7 @@ import type { ApiReportJSON } from 'flavours/glitch/api_types/reports';
|
||||
export const NOTIFICATIONS_GROUP_MAX_AVATARS = 8;
|
||||
|
||||
interface BaseNotificationGroup
|
||||
extends Omit<BaseNotificationGroupJSON, 'sample_accounts'> {
|
||||
extends Omit<BaseNotificationGroupJSON, 'sample_account_ids'> {
|
||||
sampleAccountIds: string[];
|
||||
}
|
||||
|
||||
@@ -115,8 +115,7 @@ function createAccountRelationshipSeveranceEventFromJSON(
|
||||
export function createNotificationGroupFromJSON(
|
||||
groupJson: ApiNotificationGroupJSON,
|
||||
): NotificationGroup {
|
||||
const { sample_accounts, ...group } = groupJson;
|
||||
const sampleAccountIds = sample_accounts.map((account) => account.id);
|
||||
const { sample_account_ids: sampleAccountIds, ...group } = groupJson;
|
||||
|
||||
switch (group.type) {
|
||||
case 'favourite':
|
||||
|
||||
Reference in New Issue
Block a user