Files
order_site/apps/frontend/src/utils/mock-work-order.ts
T
2026-08-21 12:39:24 +08:00

21 lines
531 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export type MockWorkOrderShop = {
sellerId: string
shopId: string
shopName: string
enabled: boolean
}
export function buildMockWorkOrderShopOptions(shops: MockWorkOrderShop[]) {
return shops
.filter((shop) => shop.enabled)
.map((shop) => {
const value = String(shop.sellerId || shop.shopId || '').trim()
const name = String(shop.shopName || shop.shopId || value).trim()
return {
value,
label: `${name}(${value})`,
}
})
.filter((shop) => Boolean(shop.value))
}