diff --git a/server/src/interfaces/registerBody.ts b/server/src/interfaces/registerBody.ts index 3c7012c..5effc72 100644 --- a/server/src/interfaces/registerBody.ts +++ b/server/src/interfaces/registerBody.ts @@ -1,6 +1,6 @@ export interface RegisterBody { - first_name: string - last_name: string + firstname: string + lastname: string email: string password: string } \ No newline at end of file diff --git a/server/src/routes/register.ts b/server/src/routes/register.ts index 9a9b295..0d3f548 100644 --- a/server/src/routes/register.ts +++ b/server/src/routes/register.ts @@ -12,8 +12,8 @@ import { private_key } from "../environment" const router: Router = express.Router(); const registerSchema = Joi.object({ - first_name: Joi.string().min(2).required(), - last_name: Joi.string().min(1).required(), + firstname: Joi.string().min(2).required(), + lastname: Joi.string().min(1).required(), email: Joi.string().email().required(), password: Joi.string().min(8).required() }); @@ -33,7 +33,12 @@ router.post("/register", async (req: Request, res: Response) => { INSERT INTO users (first_name, last_name, email, password_hash) VALUES ($1, $2, $3, $4) RETURNING id; - `, [userData.first_name, userData.last_name, userData.email, password_hash]); + `, [ + userData.firstname, + userData.lastname, + userData.email, + password_hash + ]); const user = insertResult.rows[0];