feat: penyesuaian error validasi create items #86

Merged
firmanr merged 1 commits from feat/adjustment-report into development 2024-09-11 04:05:56 +00:00
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[];
}