mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
fix: internal server error because of date parsing
This commit is contained in:
@@ -295,7 +295,7 @@ func (r *PurchaseRepositoryImpl) GetProgressRows(ctx context.Context, startDate,
|
||||
'Purchases' AS module,
|
||||
COALESCE(pf_explicit.flock_name, pf_active.flock_name, kandang_loc.name, warehouse_loc.name, 'Unknown Farm') AS farm_name,
|
||||
COALESCE(k_explicit.name, k_active.name, wk.name, `+unassignedSQL+`, 'Unknown Kandang') AS kandang_name,
|
||||
DATE(p.po_date) AS activity_date
|
||||
CAST(DATE(p.po_date) AS TEXT) AS activity_date
|
||||
`).
|
||||
Joins("JOIN purchase_items pi ON pi.purchase_id = p.id").
|
||||
Joins("JOIN warehouses w ON w.id = pi.warehouse_id").
|
||||
@@ -340,7 +340,7 @@ func (r *PurchaseRepositoryImpl) GetProgressRows(ctx context.Context, startDate,
|
||||
|
||||
rows := make([]exportprogress.Row, 0, len(scanned))
|
||||
for _, item := range scanned {
|
||||
activityDate, err := time.Parse("2006-01-02", item.ActivityDate)
|
||||
activityDate, err := exportprogress.ParseActivityDate(item.ActivityDate)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user