forked from OpenWF/SpaceNinjaServer
15 lines
502 B
TypeScript
15 lines
502 B
TypeScript
import { toCreateAccount, toDatabaseAccount } from "@/src/helpers/customHelpers";
|
|
import { createAccount } from "@/src/services/loginService";
|
|
import { RequestHandler } from "express";
|
|
|
|
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 };
|