mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-11 05:02:37 +01:00
🐛 fix vanity url
This commit is contained in:
parent
79aee5145b
commit
a54711f4ae
@ -35,15 +35,7 @@ router.patch("/", route({ body: "VanityUrlSchema", permission: "MANAGE_GUILD" })
|
||||
|
||||
const { id } = await Channel.findOneOrFail({ guild_id, type: ChannelType.GUILD_TEXT });
|
||||
|
||||
Promise.all([
|
||||
new Invite({
|
||||
code: code,
|
||||
uses: 0,
|
||||
created_at: new Date(),
|
||||
guild_id,
|
||||
channel_id: id
|
||||
}).save()
|
||||
]);
|
||||
await Invite.update({ vanity_url: true, guild_id }, { code: code, channel_id: id });
|
||||
|
||||
return res.json({ code: code });
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user