Merge pull request 'feat: penyesuaian error validasi create items' (#86) from feat/adjustment-report into development
continuous-integration/drone/push Build is passing Details

Reviewed-on: #86
fix/report
firmanr 2024-09-11 04:05:56 +00:00
commit d2db62339f
1 changed files with 9 additions and 1 deletions

View File

@ -134,7 +134,15 @@ export class ItemDto extends BaseStatusDto implements ItemEntity {
}, },
], ],
}) })
@IsArray() @IsArray({
message: (body) => {
const value = body.value;
if (!value || value?.length === 0) {
return 'Product bundling tidak boleh kosong.';
}
return 'Product bundling tidak sesuai.';
},
})
@ValidateIf((body) => body.item_type.toLowerCase() == ItemType.BUNDLING) @ValidateIf((body) => body.item_type.toLowerCase() == ItemType.BUNDLING)
bundling_items: ItemEntity[]; bundling_items: ItemEntity[];
} }