summary refs log tree commit diff
path: root/src/models/User.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-30 20:24:45 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-30 20:24:45 +0200
commit0ff1daeaff31e7fc384d571e8f3eca94c32da84e (patch)
treec9a9a83efecda99a63c25520ff6680c5207ed121 /src/models/User.ts
parent1.3.13 (diff)
downloadserver-0ff1daeaff31e7fc384d571e8f3eca94c32da84e.tar.xz
:sparkles: Relationship types
Diffstat (limited to 'src/models/User.ts')
-rw-r--r--src/models/User.ts13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/models/User.ts b/src/models/User.ts

index 76922903..31f91a4b 100644 --- a/src/models/User.ts +++ b/src/models/User.ts
@@ -80,8 +80,14 @@ export interface ConnectedAccount { export interface Relationship { id: string; nickname?: string; - type: number; - user_id: string; + type: RelationshipType; +} + +export enum RelationshipType { + outgoing = 4, + incoming = 3, + blocked = 2, + friends = 1, } export interface UserSettings { @@ -158,10 +164,9 @@ export const UserSchema = new Schema({ valid_tokens_since: Date, // all tokens with a previous issue date are invalid relationships: [ { - id: String, + id: { type: String, required: true }, nickname: String, type: { type: Number }, - user_id: String, }, ], connected_accounts: [