Fix one thing, another problem pops up
Co-authored-by: TheArcaneBrony <myrainbowdash949@gmail.com>
This commit is contained in:
parent
12a151eb2d
commit
013a4b8bc8
@ -1,4 +1,4 @@
|
|||||||
import { Channel, Message, ChannelDeleteEvent, ChannelPermissionOverwriteType, ChannelType, ChannelUpdateEvent, emitEvent, Recipient } from "@fosscord/util";
|
import { Channel, Message, Invite, ReadState, ChannelDeleteEvent, ChannelPermissionOverwriteType, ChannelType, ChannelUpdateEvent, emitEvent, Recipient } from "@fosscord/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { handleFile, route } from "@fosscord/api";
|
import { handleFile, route } from "@fosscord/api";
|
||||||
|
|
||||||
@ -32,6 +32,9 @@ router.delete("/", route({ permission: "MANAGE_CHANNELS" }), async (req: Request
|
|||||||
} else {
|
} else {
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
Message.delete({ channel_id: channel_id }),
|
Message.delete({ channel_id: channel_id }),
|
||||||
|
Invite.delete({ channel_id: channel_id }),
|
||||||
|
Recipient.delete({ channel_id: channel_id }),
|
||||||
|
ReadState.delete({ channel_id: channel_id }),
|
||||||
Channel.delete({ id: channel_id }),
|
Channel.delete({ id: channel_id }),
|
||||||
emitEvent({ event: "CHANNEL_DELETE", data: channel, channel_id } as ChannelDeleteEvent)
|
emitEvent({ event: "CHANNEL_DELETE", data: channel, channel_id } as ChannelDeleteEvent)
|
||||||
]);
|
]);
|
||||||
|
@ -59,7 +59,7 @@ router.post("/", route({ body: "RelationshipPostSchema" }), async (req: Request,
|
|||||||
relations: ["relationships", "relationships.to"],
|
relations: ["relationships", "relationships.to"],
|
||||||
select: userProjection,
|
select: userProjection,
|
||||||
where: {
|
where: {
|
||||||
discriminator: String(req.body.discriminator,).padStart(4, '0'), //Discord send the discriminator as integer, we need to add leading zeroes
|
discriminator: String(req.body.discriminator).padStart(4, '0'), //Discord send the discriminator as integer, we need to add leading zeroes
|
||||||
username: req.body.username
|
username: req.body.username
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
@ -14,6 +14,7 @@ export const ajv = new Ajv({
|
|||||||
parseDate: true,
|
parseDate: true,
|
||||||
allowDate: true,
|
allowDate: true,
|
||||||
schemas,
|
schemas,
|
||||||
|
coerceTypes: true,
|
||||||
messages: true,
|
messages: true,
|
||||||
strict: true,
|
strict: true,
|
||||||
strictRequired: true
|
strictRequired: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user