Endpoint for custom API: https://localhost:443/custom/addItem example request: { "type": "Weapon", "internalName": "/Lotus/Weapons/Grineer/Pistols/GrineerMicrowavegun/GrnMicrowavePistol", "accountId": "6488fd2e7bec200069ca4242" }
14 lines
562 B
TypeScript
14 lines
562 B
TypeScript
import { parseString } from "@/src/helpers/general";
|
|
import { toPurchaseRequest } from "@/src/helpers/purchaseHelpers";
|
|
import { handlePurchase } from "@/src/services/purchaseService";
|
|
import { Request, Response } from "express";
|
|
|
|
const purchaseController = async (req: Request, res: Response) => {
|
|
const purchaseRequest = toPurchaseRequest(JSON.parse(String(req.body)));
|
|
const accountId = parseString(req.query.accountId);
|
|
const response = await handlePurchase(purchaseRequest, accountId);
|
|
res.json(response);
|
|
};
|
|
|
|
export { purchaseController };
|