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:
co-authored by
Cursor
parent
1b16e79d3f
commit
7cef24336a
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user