From 43e5fe5ebea2bcd20555b5481be73711e7f39854 Mon Sep 17 00:00:00 2001 From: Evorp <3vorpgaming@gmail.com> Date: Fri, 12 Jan 2024 01:33:00 -0800 Subject: [PATCH] fix user types --- src/v2/interfaces/users.ts | 4 ++-- src/v2/repository/firestorm/user.repository.ts | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/v2/interfaces/users.ts b/src/v2/interfaces/users.ts index eb5a53f..1f98fda 100644 --- a/src/v2/interfaces/users.ts +++ b/src/v2/interfaces/users.ts @@ -36,7 +36,7 @@ export interface UserNames extends Array {} export interface UserProfile { id?: string; - media: Media[] | undefined; + media?: Medias; username: string | undefined; uuid: string | undefined; } @@ -44,7 +44,7 @@ export interface UserProfile { export interface User extends UserCreationParams { warns?: Array; // list of all warns id: string; // discord user id - media: Medias; + media?: Medias; } export interface Users extends Array {} diff --git a/src/v2/repository/firestorm/user.repository.ts b/src/v2/repository/firestorm/user.repository.ts index 1ee413f..0835ca7 100644 --- a/src/v2/repository/firestorm/user.repository.ts +++ b/src/v2/repository/firestorm/user.repository.ts @@ -167,8 +167,7 @@ export default class UserFirestormRepository implements UserRepository { } update(id: string, user: UserCreationParams): Promise { - /** @todo fix weird user types here */ - return users.set(id, user as any).then(() => this.getUserById(id)); + return users.set(id, user).then(() => this.getUserById(id)); } delete(id: string): Promise { @@ -183,7 +182,7 @@ export default class UserFirestormRepository implements UserRepository { username: string; uuid: string; anonymous: boolean; - media: Medias; + media?: Medias; }>, ) => _users.map((el) => ({