refactor(database): ♻️ Make user avatar and header into a Media instead of plaintext

This commit is contained in:
Jesse Wierzbinski 2025-01-28 19:07:55 +01:00
parent bc961b70bb
commit ba431e2b11
No known key found for this signature in database
11 changed files with 2480 additions and 89 deletions

View file

@ -2,6 +2,7 @@ import {
type Application,
type Emoji,
type Instance,
type Media,
type Role,
type Token,
type User,
@ -22,6 +23,8 @@ export const userRelations = {
},
},
},
avatar: true,
header: true,
roles: {
with: {
role: true,
@ -76,6 +79,8 @@ export const transformOutputToUserWithRelations = (
followerCount: unknown;
followingCount: unknown;
statusCount: unknown;
avatar: typeof Media.$type | null;
header: typeof Media.$type | null;
emojis: {
userId: string;
emojiId: string;