17 lines
518 B
JavaScript
17 lines
518 B
JavaScript
|
||
const {mapBreadcrumbToResponse} =require( "./breadCrumb.adapter")
|
||
|
||
function mapCategoryToCategoryDetailsResponse(category, breadcrumb) {
|
||
return {
|
||
id: category.id,
|
||
name: category.name,
|
||
slug: category.slug,
|
||
description: category.description || "Açıklama bulunmuyor", // Kategorinin açıklaması varsa, yoksa varsayılan mesaj
|
||
breadcrumb: mapBreadcrumbToResponse(breadcrumb), // breadcrumb'ı uygun formatta döndürüyoruz
|
||
};
|
||
}
|
||
|
||
module.exports = {
|
||
mapCategoryToCategoryDetailsResponse,
|
||
};
|