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";
|
2025-03-16 08:16:27 -07:00
|
|
|
import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
|
2024-05-06 15:38:10 +02:00
|
|
|
|
|
|
|
export const setSupportedSyndicateController: RequestHandler = async (req, res) => {
|
2024-05-28 13:45:06 +02:00
|
|
|
const accountId = await getAccountIdForRequest(req);
|
2025-03-16 08:16:27 -07:00
|
|
|
|
|
|
|
await Inventory.updateOne(
|
|
|
|
{
|
|
|
|
accountOwnerId: accountId
|
|
|
|
},
|
|
|
|
{
|
|
|
|
SupportedSyndicate: req.query.syndicate as string
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2024-05-06 15:38:10 +02:00
|
|
|
res.end();
|
|
|
|
};
|