forked from OpenWF/SpaceNinjaServer
Endpoint for custom API: https://localhost:443/custom/addItem example request: { "type": "Weapon", "internalName": "/Lotus/Weapons/Grineer/Pistols/GrineerMicrowavegun/GrnMicrowavePistol", "accountId": "6488fd2e7bec200069ca4242" }
16 lines
583 B
TypeScript
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 };
|