Production readiness hardening and ops tooling
This commit is contained in:
@ -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";
|
||||
|
||||
Reference in New Issue
Block a user