Creating Band edit page

This commit is contained in:
2024-10-26 14:35:33 +02:00
parent db72a94468
commit 76a98b8a16
16 changed files with 377 additions and 41 deletions

View File

@@ -43,7 +43,7 @@ account.post("/login", (req: Request, res: Response) => {
})
// Creating a new user
account.post("/", (req: Request, res: Response) => {
account.post("/", async (req: Request, res: Response) => {
// Check if username is valid
if (!validateString(req.body.username, 4))
{
@@ -65,6 +65,15 @@ account.post("/", (req: Request, res: Response) => {
}
// Create account
await AccountRole.findOne({
where: {
name: "User"
}
})
.then(role => {
req.body["accountRoleId"] = role.id
})
Account.create(req.body)
.then(account => {
// Status: 201 Created