feat: penyesuaian error validasi create items
continuous-integration/drone/push Build is passing Details

pull/86/head
Firman Ramdhani 2024-09-11 11:05:36 +07:00
parent f7198010d3
commit 07d1cc78e2
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)
bundling_items: ItemEntity[];
}