summary refs log tree commit diff
path: root/api/src/util
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-27 11:10:42 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-27 11:10:42 +0200
commit2dbbd21f734b6c0785d5a02d8aed71f7f32d4cff (patch)
treeb434b23a73779008964d837f1e316604de61a29e /api/src/util
parent:sparkles: use RelationId (diff)
downloadserver-2dbbd21f734b6c0785d5a02d8aed71f7f32d4cff.tar.xz
:construction: api
Diffstat (limited to 'api/src/util')
-rw-r--r--api/src/util/Channel.ts2
-rw-r--r--api/src/util/User.ts16
2 files changed, 1 insertions, 17 deletions
diff --git a/api/src/util/Channel.ts b/api/src/util/Channel.ts

index a618d2df..f518aefd 100644 --- a/api/src/util/Channel.ts +++ b/api/src/util/Channel.ts
@@ -57,7 +57,7 @@ export async function createChannel( recipient_ids: null }).save(); - await emitEvent({ event: "CHANNEL_CREATE", data: channel), guild_id: channel.guild_id } as ChannelCreateEvent; + await emitEvent({ event: "CHANNEL_CREATE", data: channel, guild_id: channel.guild_id } as ChannelCreateEvent); return channel; } diff --git a/api/src/util/User.ts b/api/src/util/User.ts deleted file mode 100644
index 4d9065c4..00000000 --- a/api/src/util/User.ts +++ /dev/null
@@ -1,16 +0,0 @@ -import { toObject, User, PublicUserProjection } from "@fosscord/util"; -import { HTTPError } from "lambert-server"; - -export { PublicUserProjection }; - -export async function getPublicUser(user_id: string, additional_fields?: any) { - const user = await User.findOneOrFail( - { id: user_id }, - { - ...PublicUserProjection, - ...additional_fields - } - ); - if (!user) throw new HTTPError("User not found", 404); - return user; -}