fix response for decos aborted
All checks were successful
Build / build (18) (push) Successful in 40s
Build / build (20) (push) Successful in 52s
Build / build (22) (push) Successful in 37s
Build / build (22) (pull_request) Successful in 36s
Build / build (20) (pull_request) Successful in 54s
Build / build (18) (pull_request) Successful in 1m1s

This commit is contained in:
Sainan 2025-03-05 05:28:05 +01:00
parent aea1a63c56
commit b62b62f486
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ export const abortDojoComponentController: RequestHandler = async (req, res) =>
}
await guild.save();
res.json(getDojoClient(guild, 0));
res.json(getDojoClient(guild, 0, request.ComponentId));
};
interface IAbortDojoComponentRequest {

View File

@ -32,7 +32,7 @@ export const getGuildForRequestEx = async (
export const getDojoClient = (
guild: TGuildDatabaseDocument,
status: number,
componentId: Types.ObjectId | undefined = undefined
componentId: Types.ObjectId | string | undefined = undefined
): IDojoClient => {
const dojo: IDojoClient = {
_id: { $oid: guild._id.toString() },
@ -47,7 +47,7 @@ export const getDojoClient = (
DojoComponents: []
};
guild.DojoComponents.forEach(dojoComponent => {
if (!componentId || componentId == dojoComponent._id) {
if (!componentId || dojoComponent._id.equals(componentId)) {
const clientComponent: IDojoComponentClient = {
id: toOid(dojoComponent._id),
pf: dojoComponent.pf,