fix(user): fix CreateUser endpoint handler

This commit is contained in:
Vyacheslav1557 2025-02-25 23:02:21 +05:00
parent a7f2299f3f
commit 2a18e1d42f
2 changed files with 10 additions and 3 deletions

View file

@ -153,10 +153,17 @@ func (h *UserHandlers) CreateUser(c *fiber.Ctx) error {
ctx := c.Context() ctx := c.Context()
var req = &userv1.CreateUserRequest{}
err := c.BodyParser(req)
if err != nil {
return c.SendStatus(fiber.StatusBadRequest)
}
id, err := h.userUC.CreateUser( id, err := h.userUC.CreateUser(
ctx, ctx,
c.FormValue("username"), req.Username,
c.FormValue("password"), req.Password,
models.RoleStudent, models.RoleStudent,
) )
if err != nil { if err != nil {

2
proto

@ -1 +1 @@
Subproject commit b7ea2e6cc71f7393f9afe722204c5c33b6a6f2b6 Subproject commit c1b7fd7a2d32678641ebd3acfe3d5b2eca5d0c72