feat: add public product catalog boundary
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
function toIsoString(value) {
|
||||
return value instanceof Date ? value.toISOString() : value;
|
||||
}
|
||||
|
||||
export function toPublicProductDto(product) {
|
||||
return {
|
||||
id: product.id,
|
||||
categoryId: product.categoryId,
|
||||
name: product.name,
|
||||
slug: product.slug,
|
||||
description: product.description ?? null,
|
||||
brand: product.brand ?? null,
|
||||
setName: product.setName ?? null,
|
||||
cardNumber: product.cardNumber ?? null,
|
||||
eventName: product.eventName ?? null,
|
||||
releaseYear: product.releaseYear ?? null,
|
||||
createdAt: toIsoString(product.createdAt),
|
||||
updatedAt: toIsoString(product.updatedAt),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user