mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(database): ♻️ Make user avatar and header into a Media instead of plaintext
This commit is contained in:
parent
bc961b70bb
commit
ba431e2b11
11 changed files with 2480 additions and 89 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue