mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
Feat[BE]: refactor expense API and expense table match with new ERD
This commit is contained in:
@@ -155,6 +155,18 @@ func (u *ExpenseController) UpdateOne(c *fiber.Ctx) error {
|
||||
req.TransactionDate = &transactionDate
|
||||
}
|
||||
|
||||
categoryVal := c.FormValue("category")
|
||||
req.Category = &categoryVal
|
||||
|
||||
supplierIDVal := c.FormValue("supplier_id")
|
||||
if supplierIDVal != "" {
|
||||
supplierID, err := strconv.ParseUint(supplierIDVal, 10, 64)
|
||||
if err != nil {
|
||||
return fiber.NewError(fiber.StatusBadRequest, "Invalid supplier_id format")
|
||||
}
|
||||
req.SupplierID = &supplierID
|
||||
}
|
||||
|
||||
costPerKandangJSON := c.FormValue("cost_per_kandang")
|
||||
if costPerKandangJSON != "" {
|
||||
var costPerKandang []validation.CostPerKandang
|
||||
|
||||
Reference in New Issue
Block a user