SpaceNinjaServer/src/controllers/api/genericUpdateController.ts

13 lines
538 B
TypeScript
Raw Normal View History

import { updateGeneric } from "@/src/services/inventoryService";
2023-06-01 17:08:05 -07:00
import { RequestHandler } from "express";
2024-05-03 15:37:43 +02:00
import { getJSONfromString } from "@/src/helpers/stringHelpers";
2023-06-01 17:08:05 -07:00
// eslint-disable-next-line @typescript-eslint/no-misused-promises
2024-05-03 15:37:43 +02:00
const genericUpdateController: RequestHandler = async (request, response) => {
const accountId = request.query.accountId as string;
const update = getJSONfromString(request.body.toString());
response.json(await updateGeneric(update, accountId));
2023-06-01 17:08:05 -07:00
};
2023-06-02 00:20:49 -03:00
export { genericUpdateController };