2024-05-06 15:38:10 +02:00
|
|
|
import { RequestHandler } from "express";
|
2024-05-28 13:45:06 +02:00
|
|
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
2024-05-06 15:38:10 +02:00
|
|
|
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);
|
2024-05-06 15:38:10 +02:00
|
|
|
inventory.SupportedSyndicate = req.query.syndicate as string;
|
|
|
|
await inventory.save();
|
|
|
|
res.end();
|
|
|
|
};
|