Feat[Be-117]: Menambahkan note upda update chickin api

This commit is contained in:
aguhh18
2025-10-24 11:16:12 +07:00
parent 222d53aa37
commit 7f2175a8cf
2 changed files with 4 additions and 0 deletions
@@ -222,6 +222,9 @@ func (s chickinService) UpdateOne(c *fiber.Ctx, req *validation.Update, id uint)
if req.ChickInDate != "" { if req.ChickInDate != "" {
updateBody["chick_in_date"] = req.ChickInDate updateBody["chick_in_date"] = req.ChickInDate
} }
if req.Note != "" {
updateBody["note"] = req.Note
}
if len(updateBody) == 0 { if len(updateBody) == 0 {
return s.GetOne(c, id) return s.GetOne(c, id)
} }
@@ -8,6 +8,7 @@ type Create struct {
type Update struct { type Update struct {
ChickInDate string `json:"chick_in_date" validate:"required,datetime=2006-01-02"` ChickInDate string `json:"chick_in_date" validate:"required,datetime=2006-01-02"`
Note string `json:"note" validate:"omitempty"`
} }
type Query struct { type Query struct {