Create authorization by role

This commit is contained in:
valitovgaziz
2024-08-25 06:07:48 +05:00
parent 0e50f3826f
commit 1f967a28f7
4 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -34,8 +34,10 @@ func Register(w http.ResponseWriter, r *http.Request) {
Email: Credentials.Email,
Password: hashedPassword,
Phone: Credentials.Phone,
Role: Credentials.Role,
}
if result := psql.PSQL_GORM_DB.Create(&user); result.Error != nil {
result := psql.PSQL_GORM_DB.Create(&user)
if result.Error != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}