mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
cmd: only check blocked references if delete kandang warehouse flag enabled
This commit is contained in:
@@ -314,7 +314,8 @@ func buildReferencePlan(ctx context.Context, db *gorm.DB) (*referencePlan, error
|
||||
}
|
||||
|
||||
func runPrechecks(ctx context.Context, db *gorm.DB, rows []consolidateRow, refs *referencePlan, opts *options) error {
|
||||
if !opts.SkipBlockedRefsCheck {
|
||||
// Only check blocked references if we're actually deleting the warehouses
|
||||
if opts.DeleteKandangWarehouses && !opts.SkipBlockedRefsCheck {
|
||||
if err := ensureNoBlockedWarehouseRefsConsolidate(ctx, db, rows, refs.BlockedWarehouseRefs); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user