Initial admin edits
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import type { Company } from '@/types'
|
||||
|
||||
/** همتراز با slug شرکت دریافتکننده پرداخت در سرور */
|
||||
export const PAYMENT_RECIPIENT_COMPANY_SLUG = 'nademitex'
|
||||
|
||||
export function productCompanyIdForForm(
|
||||
companyId: string | undefined,
|
||||
companyList: Company[],
|
||||
): string {
|
||||
const row = companyList.find((c) => c.id === companyId)
|
||||
if (!row || row.slug === PAYMENT_RECIPIENT_COMPANY_SLUG) return ''
|
||||
return companyId ?? ''
|
||||
}
|
||||
|
||||
export function resolveProductCompanyPayload(formCompanyId: string): string | undefined {
|
||||
const trimmed = formCompanyId.trim()
|
||||
return trimmed.length > 0 ? trimmed : undefined
|
||||
}
|
||||
Reference in New Issue
Block a user