Improve product cards/pagination, Farsi locale fonts, and super-admin migrate UI.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
2e40d5eb4c
commit
f5b2193ba1
@@ -9,6 +9,8 @@ export interface PortfolioApi {
|
||||
id: string
|
||||
businessId: string
|
||||
title: string
|
||||
titleFa: string
|
||||
titleEn: string | null
|
||||
slug: string
|
||||
abstract: string
|
||||
mainTextHtml: string
|
||||
@@ -51,7 +53,10 @@ function businessPath(suffix = '') {
|
||||
}
|
||||
|
||||
export interface CreatePortfolioPayload {
|
||||
title: string
|
||||
titleFa: string
|
||||
titleEn?: string
|
||||
/** @deprecated Prefer titleFa */
|
||||
title?: string
|
||||
abstract?: string
|
||||
mainTextHtml?: string
|
||||
categoryId?: string
|
||||
@@ -63,6 +68,9 @@ export interface CreatePortfolioPayload {
|
||||
}
|
||||
|
||||
export interface UpdatePortfolioPayload {
|
||||
titleFa?: string
|
||||
titleEn?: string | null
|
||||
/** @deprecated Prefer titleFa */
|
||||
title?: string
|
||||
abstract?: string | null
|
||||
mainTextHtml?: string | null
|
||||
@@ -87,7 +95,9 @@ export function resolvePortfolioTitleImageUrl(portfolio: PortfolioApi): string |
|
||||
export function mapPortfolioApiToUi(portfolio: PortfolioApi): Portfolio {
|
||||
return {
|
||||
id: portfolio.id,
|
||||
title: portfolio.title,
|
||||
title: portfolio.titleFa || portfolio.title,
|
||||
titleFa: portfolio.titleFa || portfolio.title,
|
||||
titleEn: portfolio.titleEn ?? null,
|
||||
slug: portfolio.slug,
|
||||
abstract: portfolio.abstract,
|
||||
status: portfolio.status,
|
||||
@@ -134,7 +144,8 @@ export function mapPortfolioDetailFromApi(portfolio: PortfolioApi): PortfolioDet
|
||||
|
||||
export function mapPortfolioApiToFormState(portfolio: PortfolioApi) {
|
||||
return {
|
||||
title: portfolio.title,
|
||||
titleFa: portfolio.titleFa || portfolio.title,
|
||||
titleEn: portfolio.titleEn ?? '',
|
||||
abstract: portfolio.abstract,
|
||||
mainTextHtml: portfolio.mainTextHtml,
|
||||
categoryId: portfolio.categoryId ?? '',
|
||||
|
||||
Reference in New Issue
Block a user