Add callback and update user role

This commit is contained in:
aditya.siregar
2024-06-05 00:24:53 +07:00
parent 4d402e32c9
commit 04a89c5508
27 changed files with 388 additions and 49 deletions
+6
View File
@@ -1,6 +1,7 @@
package user
import (
"furtuna-be/internal/constants/role"
"net/http"
"strconv"
"time"
@@ -64,6 +65,11 @@ func (h *Handler) Create(c *gin.Context) {
}
}
if req.RoleID == role.Casheer && req.SiteID == nil {
response.ErrorWrapper(c, errors.NewServiceException("site id is required for cashier"))
return
}
res, err := h.service.Create(ctx, req.ToEntity())
if err != nil {
response.ErrorWrapper(c, err)