Use /{id}/{fa-slug} detail URLs in sitemaps and add public by-id lookups.

Default sitemap templates now emit SEO-friendly Farsi path segments with stable CMS ids; storefronts resolve content via new by-id public endpoints.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-22 23:43:25 +03:30
co-authored by Cursor
parent 1b16e79d3f
commit 7cef24336a
16 changed files with 495 additions and 25 deletions
+31
View File
@@ -468,6 +468,37 @@ export class PortfoliosService {
};
}
async getPublicById(host: string, portfolioIdRaw: string) {
const business = await this.tenant.resolveBusinessByDomain(host);
const businessId = business.id;
let portfolioId: bigint;
try {
portfolioId = BigInt(portfolioIdRaw);
} catch {
throw new NotFoundException('Portfolio not found');
}
const portfolio = await this.prisma.portfolios.findFirst({
where: {
business_id: businessId,
id: portfolioId,
status: ContentStatus.published,
},
include: portfolioInclude,
});
if (!portfolio) {
throw new NotFoundException('Portfolio not found');
}
return {
portfolio: await this.serializePortfolio(portfolio, {
includeComments: true,
approvedCommentsOnly: true,
}),
};
}
async listCommentsPublic(host: string, portfolioIdRaw: string) {
const business = await this.tenant.resolveBusinessByDomain(host);
const businessId = business.id;