SpaceNinjaServerOnlyGit/src/controllers/api/abortDojoComponentDestructionController.ts
Sainan 77aa1caa8f feat: dojo room destruction stage (#1089)
Closes #1074

Based on what I could find, apparently only rooms need 2 hours to destroy and decos are removed instantly.

Reviewed-on: OpenWF/SpaceNinjaServer#1089
2025-03-06 07:19:01 -08:00

13 lines
481 B
TypeScript

import { getDojoClient, getGuildForRequest } from "@/src/services/guildService";
import { RequestHandler } from "express";
export const abortDojoComponentDestructionController: RequestHandler = async (req, res) => {
const guild = await getGuildForRequest(req);
const componentId = req.query.componentId as string;
guild.DojoComponents.id(componentId)!.DestructionTime = undefined;
await guild.save();
res.json(await getDojoClient(guild, 0, componentId));
};