work on adding group support
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-10 09:16:52 +11:00
parent 48611b22c9
commit 0899b07d47
6 changed files with 83 additions and 12 deletions

View File

@@ -15,7 +15,7 @@ import (
"golang.org/x/crypto/bcrypt"
)
type RegisterInput struct {
type AddUserInput struct {
UserName string `json:"userName" binding:"required"`
Password string `json:"password" binding:"required"`
GroupId int `json:"groupId"`
@@ -73,8 +73,8 @@ func DeleteUser(c *gin.Context) {
}
}
func RegisterUser(c *gin.Context) {
var input RegisterInput
func AddUser(c *gin.Context) {
var input AddUserInput
if err := c.ShouldBindJSON(&input); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})