mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 15:13:05 +00:00
Deprecation: Use object-based relations for typeorm
This commit is contained in:
1 parent
7c247aedb9
commit
6162fbd520
55 files changed
+151
-137
No files matched your search
@@ -69,7 +69,7 @@ router.post("/", route({}), async (req: Request, res: Response) => {
|
||||
interactionData.app_permissions = (await getPermission(body.application_id, body.guild_id, body.channel_id)).bitfield.toString();
|
||||
|
||||
const guild = await Guild.findOneOrFail({ where: { id: body.guild_id } });
|
||||
const member = await Member.findOneOrFail({ where: { guild_id: body.guild_id, id: req.user_id }, relations: ["user"] });
|
||||
const member = await Member.findOneOrFail({ where: { guild_id: body.guild_id, id: req.user_id }, relations: { user: true } });
|
||||
|
||||
interactionData.guild = {
|
||||
id: guild.id,
|
||||
@@ -91,7 +91,7 @@ router.post("/", route({}), async (req: Request, res: Response) => {
|
||||
}
|
||||
|
||||
if (body.type === InteractionType.MessageComponent || body.data.type === InteractionType.ModalSubmit) {
|
||||
interactionData.message = await Message.findOneOrFail({ where: { id: body.message_id, flags: undefined }, relations: ["author"] });
|
||||
interactionData.message = await Message.findOneOrFail({ where: { id: body.message_id, flags: undefined }, relations: { author: true } });
|
||||
}
|
||||
|
||||
emitEvent({
|
||||
|
||||
Reference in new issue
Block a user