mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-26 08:15:43 +00:00
cmd: check validate and fix bug risks in commands
This commit is contained in:
@@ -729,6 +729,9 @@ func reflowAndRecalculateProductWarehouse(
|
||||
if err != nil {
|
||||
return fmt.Errorf("resolve flag group for product_warehouse %d: %w", productWarehouseID, err)
|
||||
}
|
||||
if flagGroupCode == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
if _, err := fifoSvc.Reflow(ctx, commonSvc.FifoStockV2ReflowRequest{
|
||||
FlagGroupCode: flagGroupCode,
|
||||
@@ -778,6 +781,9 @@ func resolveFlagGroupByProductWarehouse(ctx context.Context, tx *gorm.DB, produc
|
||||
Order("rr.id ASC").
|
||||
Limit(1).
|
||||
Take(&selected).Error
|
||||
if err == gorm.ErrRecordNotFound {
|
||||
return "", nil
|
||||
}
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user