mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
FIX[BE]: period and adjustment helper to function
This commit is contained in:
@@ -101,7 +101,11 @@ func (s *kandangService) CreateOne(c *fiber.Ctx, req *validation.Create) (*entit
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
status := strings.ToUpper(req.Status)
|
||||
|
||||
status := strings.ToUpper(strings.TrimSpace(req.Status))
|
||||
if status == "" {
|
||||
status = string(utils.KandangStatusNonActive)
|
||||
}
|
||||
if !utils.IsValidKandangStatus(status) {
|
||||
return nil, fiber.NewError(fiber.StatusBadRequest, "Invalid kandang status")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user