SpaceNinjaServer/src/controllers/api/setSupportedSyndicateController.ts

12 lines
484 B
TypeScript
Raw Normal View History

import { RequestHandler } from "express";
2024-05-28 13:45:06 +02:00
import { getAccountIdForRequest } from "@/src/services/loginService";
import { getInventory } from "@/src/services/inventoryService";
export const setSupportedSyndicateController: RequestHandler = async (req, res) => {
2024-05-28 13:45:06 +02:00
const accountId = await getAccountIdForRequest(req);
const inventory = await getInventory(accountId);
inventory.SupportedSyndicate = req.query.syndicate as string;
await inventory.save();
res.end();
};