feat(admin): let price alerts pick a product
Show the product on the form and table so each alert is tied to one item. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+2
-16
@@ -332,23 +332,9 @@ async function bootstrapSettingsFromApi(): Promise<void> {
|
||||
|
||||
try {
|
||||
const { getConfiguration } = await import('@/api/configuration')
|
||||
const { fetchSuperAdminProgramSettings, isLockedCanEdit } = await import('@/api/superadminSettings')
|
||||
const { parseMainWalletProductIds } = await import('@/components/mobile/utils/wallet')
|
||||
const localRows = await getConfiguration().catch(() => [])
|
||||
const saRows = await fetchSuperAdminProgramSettings()
|
||||
const local = Array.isArray(localRows) ? localRows : []
|
||||
const editable = local.filter((row) => !isLockedCanEdit(row?.can_edit))
|
||||
const merged = [...saRows] as typeof local
|
||||
for (const item of editable) {
|
||||
if (!item?.key) continue
|
||||
const index = merged.findIndex((row) => row.key === item.key)
|
||||
if (index >= 0) {
|
||||
merged[index] = { ...merged[index], ...item }
|
||||
} else {
|
||||
merged.push(item)
|
||||
}
|
||||
}
|
||||
const list = merged
|
||||
const rows = await getConfiguration()
|
||||
const list = Array.isArray(rows) ? rows : []
|
||||
const isStoreRow = list.find((item) => item.key === 'is_store')
|
||||
const mainWalletRow = list.find((item) => item.key === 'main_wallet_products')
|
||||
const mainMetalRow = list.find((item) => item.key === 'main_metal')
|
||||
|
||||
Reference in New Issue
Block a user