SpaceNinjaServer/src/controllers/custom/createAccountController.ts
OrdisPrime d091af4778
Basic purchasing + custom purchasing API (#20)
Endpoint for custom API: https://localhost:443/custom/addItem
example request:
{
"type": "Weapon",
"internalName": "/Lotus/Weapons/Grineer/Pistols/GrineerMicrowavegun/GrnMicrowavePistol",
"accountId": "6488fd2e7bec200069ca4242"
}
2023-06-14 02:26:19 +02:00

16 lines
583 B
TypeScript

import { toCreateAccount, toDatabaseAccount } from "@/src/helpers/customHelpers/customHelpers";
import { createAccount } from "@/src/services/loginService";
import { RequestHandler } from "express";
// eslint-disable-next-line @typescript-eslint/no-misused-promises
const createAccountController: RequestHandler = async (req, res) => {
const createAccountData = toCreateAccount(req.body);
const databaseAccount = toDatabaseAccount(createAccountData);
const account = await createAccount(databaseAccount);
res.json(account);
};
export { createAccountController };