SpaceNinjaServer/src/controllers/custom/removeCustomizationController.ts
AMelonInsideLemon 7e437d75bf
All checks were successful
Build / build (push) Successful in 1m22s
Build Docker image / docker-amd64 (push) Successful in 1m4s
Build Docker image / docker-arm64 (push) Successful in 1m14s
feat(webui): flavour Items (#2779)
Re #2361

Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Reviewed-on: #2779
Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com>
Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
2025-09-14 23:31:43 -07:00

15 lines
648 B
TypeScript

import { getAccountIdForRequest } from "../../services/loginService.ts";
import { getInventory } from "../../services/inventoryService.ts";
import type { RequestHandler } from "express";
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
export const removeCustomizationController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req);
const ItemType = req.query.itemType as string;
const inventory = await getInventory(accountId, "FlavourItems");
inventory.FlavourItems.pull({ ItemType });
await inventory.save();
res.end();
broadcastInventoryUpdate(req);
};