inline token metadata into the notification instead of just storing the ID

This commit is contained in:
Hazelnoot 2025-06-22 12:02:31 -04:00
parent 156c7e9543
commit b62f6ca042
5 changed files with 16 additions and 37 deletions

View file

@ -157,7 +157,8 @@ export type MiNotification = {
id: string;
createdAt: string;
notifierId: MiUser['id'];
tokenId: MiAccessToken['id'];
permCount: number;
rank: 'user' | 'mod' | 'admin' | null;
} | {
type: 'sharedAccessRevoked';
id: string;

View file

@ -479,27 +479,14 @@ export const packedNotificationSchema = {
optional: false, nullable: false,
format: 'id',
},
token: {
type: 'object',
optional: false, nullable: true,
properties: {
id: {
type: 'string',
optional: false, nullable: false,
},
permission: {
type: 'array',
optional: false, nullable: false,
items: {
type: 'string',
},
},
rank: {
type: 'string',
enum: ['admin', 'mod', 'user'],
optional: false, nullable: true,
},
},
permCount: {
type: 'number',
optional: true, nullable: false,
},
rank: {
type: 'string',
enum: ['admin', 'mod', 'user'],
optional: true, nullable: true,
},
},
}, {