mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-22 19:43:16 +00:00
🚧 api
This commit is contained in:
1 parent
db3f5c0d1b
commit
2dbbd21f73
17 files changed
+97
-127
No files matched your search
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user