Production readiness hardening and ops tooling

This commit is contained in:
2026-05-29 10:10:12 +07:00
parent e0b8f9af9a
commit 648e77cee9
68 changed files with 12222 additions and 848 deletions

View File

@ -490,16 +490,22 @@
const loadMerchant = async () => {
try {
api.requireToken();
if (!merchantId) {
let selectedMerchantId = merchantId;
if (!selectedMerchantId) {
const merchants = await api.listMerchants();
selectedMerchantId = Array.isArray(merchants) && merchants.length ? merchants[0].id : "";
}
if (!selectedMerchantId) {
showToast("Missing merchant_id in URL");
return;
}
const [merchant, outlets, devices, txs] = await Promise.all([
api.getMerchant(merchantId),
api.listOutlets({ merchant_id: merchantId }),
api.listDevices({ merchant_id: merchantId }),
api.listTransactions({ merchant_id: merchantId })
api.getMerchant(selectedMerchantId),
api.listOutlets({ merchant_id: selectedMerchantId }),
api.listDevices({ merchant_id: selectedMerchantId }),
api.listTransactions({ merchant_id: selectedMerchantId })
]);
const name = merchant.legal_name || merchant.brand_name || "Merchant";