UPDATE: fix bug
All checks were successful
Build and Release / release (push) Successful in 1m8s

This commit is contained in:
2026-04-14 17:33:58 +07:00
parent 7f30dff737
commit 4e1e9892ac
6 changed files with 51 additions and 49 deletions

View File

@@ -48,7 +48,7 @@ func (h *AuthController) Signin(c fiber.Ctx) error {
if err := validator.ValidateBodyDto(c, dto); err != nil {
return c.Status(fiber.StatusBadRequest).JSON(response.CommonResponse{
Status: false,
Message: err.Error(),
Errors: err,
})
}
@@ -102,7 +102,7 @@ func (h *AuthController) Signup(c fiber.Ctx) error {
if err := validator.ValidateBodyDto(c, dto); err != nil {
return c.Status(fiber.StatusBadRequest).JSON(response.CommonResponse{
Status: false,
Message: err.Error(),
Errors: err,
})
}
@@ -221,7 +221,7 @@ func (h *AuthController) VerifyToken(c fiber.Ctx) error {
if err := validator.ValidateBodyDto(c, dto); err != nil {
return c.Status(fiber.StatusBadRequest).JSON(response.CommonResponse{
Status: false,
Message: err.Error(),
Errors: err,
})
}
@@ -258,7 +258,7 @@ func (h *AuthController) CreateToken(c fiber.Ctx) error {
if err := validator.ValidateBodyDto(c, dto); err != nil {
return c.Status(fiber.StatusBadRequest).JSON(response.CommonResponse{
Status: false,
Message: err.Error(),
Errors: err,
})
}
@@ -295,7 +295,7 @@ func (h *AuthController) ForgotPassword(c fiber.Ctx) error {
if err := validator.ValidateBodyDto(c, dto); err != nil {
return c.Status(fiber.StatusBadRequest).JSON(response.CommonResponse{
Status: false,
Message: err.Error(),
Errors: err,
})
}

View File

@@ -67,7 +67,7 @@ func (m *MediaController) SearchMedia(c fiber.Ctx) error {
if err := validator.ValidateQueryDto(c, dto); err != nil {
return c.Status(fiber.StatusBadRequest).JSON(response.CommonResponse{
Status: false,
Message: err.Error(),
Errors: err,
})
}
res, err := m.service.SearchMedia(ctx, dto)
@@ -158,7 +158,7 @@ func (m *MediaController) BulkDeleteMedia(c fiber.Ctx) error {
if err := validator.ValidateBodyDto(c, dto); err != nil {
return c.Status(fiber.StatusBadRequest).JSON(response.CommonResponse{
Status: false,
Message: err.Error(),
Errors: err,
})
}
@@ -233,7 +233,7 @@ func (m *MediaController) GeneratePresignedURL(c fiber.Ctx) error {
if err := validator.ValidateQueryDto(c, dto); err != nil {
return c.Status(fiber.StatusBadRequest).JSON(response.CommonResponse{
Status: false,
Message: err.Error(),
Errors: err,
})
}
res, err := m.service.GeneratePresignedURL(ctx, c.Locals("uid").(string), dto)
@@ -266,7 +266,7 @@ func (m *MediaController) PreSignedCompleted(c fiber.Ctx) error {
if err := validator.ValidateBodyDto(c, dto); err != nil {
return c.Status(fiber.StatusBadRequest).JSON(response.CommonResponse{
Status: false,
Message: err.Error(),
Errors: err,
})
}
res, err := m.service.PreSignedCompleted(ctx, c.Locals("uid").(string), dto)

View File

@@ -188,7 +188,7 @@ func (h *UserController) UpdateProfile(c fiber.Ctx) error {
if err := validator.ValidateBodyDto(c, dto); err != nil {
return c.Status(fiber.StatusBadRequest).JSON(response.CommonResponse{
Status: false,
Message: err.Error(),
Errors: err,
})
}
@@ -225,7 +225,7 @@ func (h *UserController) ChangePassword(c fiber.Ctx) error {
if err := validator.ValidateBodyDto(c, dto); err != nil {
return c.Status(fiber.StatusBadRequest).JSON(response.CommonResponse{
Status: false,
Message: err.Error(),
Errors: err,
})
}
err := h.service.ChangePassword(ctx, c.Locals("uid").(string), dto)
@@ -318,7 +318,7 @@ func (h *UserController) ChangeRoleUser(c fiber.Ctx) error {
if err := validator.ValidateBodyDto(c, dto); err != nil {
return c.Status(fiber.StatusBadRequest).JSON(response.CommonResponse{
Status: false,
Message: err.Error(),
Errors: err,
})
}
claimsVal := c.Locals("user_claims")
@@ -398,7 +398,7 @@ func (h *UserController) SearchUser(c fiber.Ctx) error {
if err := validator.ValidateQueryDto(c, dto); err != nil {
return c.Status(fiber.StatusBadRequest).JSON(response.CommonResponse{
Status: false,
Message: err.Error(),
Errors: err,
})
}
res, err := h.service.SearchUser(ctx, dto)

View File

@@ -64,7 +64,7 @@ func (m *VerificationController) SearchVerification(c fiber.Ctx) error {
if err := validator.ValidateQueryDto(c, dto); err != nil {
return c.Status(fiber.StatusBadRequest).JSON(response.CommonResponse{
Status: false,
Message: err.Error(),
Errors: err,
})
}
res, err := m.service.SearchVerification(ctx, dto)
@@ -138,7 +138,7 @@ func (m *VerificationController) CreateVerification(c fiber.Ctx) error {
if err := validator.ValidateBodyDto(c, dto); err != nil {
return c.Status(fiber.StatusBadRequest).JSON(response.CommonResponse{
Status: false,
Message: err.Error(),
Errors: err,
})
}
res, err := m.service.CreateVerification(ctx, c.Locals("uid").(string), dto)
@@ -171,7 +171,7 @@ func (m *VerificationController) UpdateVerificationStatus(c fiber.Ctx) error {
if err := validator.ValidateBodyDto(c, dto); err != nil {
return c.Status(fiber.StatusBadRequest).JSON(response.CommonResponse{
Status: false,
Message: err.Error(),
Errors: err,
})
}
verificationId := c.Params("id")

View File

@@ -9,6 +9,7 @@ import (
type CommonResponse struct {
Status bool `json:"status"`
Data any `json:"data"`
Errors any `json:"errors"`
Message string `json:"message"`
}
@@ -30,6 +31,7 @@ type PaginatedResponse struct {
Status bool `json:"status"`
Message string `json:"message"`
Data any `json:"data"`
Errors any `json:"errors"`
Pagination *PaginationMeta `json:"pagination"`
}