Refresh after an order sync
This commit is contained in:
@@ -26,14 +26,16 @@
|
||||
async function sync(wOrderId: string) {
|
||||
syncingWOrderId = wOrderId;
|
||||
loadError = null;
|
||||
let syncError: string | null = null;
|
||||
try {
|
||||
const res = await api.commerce.orders.sync({ wOrderId }).post();
|
||||
if (res.error) throw res.error;
|
||||
} catch (err) {
|
||||
loadError = errorMessage(err);
|
||||
} finally {
|
||||
syncingWOrderId = null;
|
||||
syncError = errorMessage(err);
|
||||
}
|
||||
await refresh();
|
||||
if (syncError) loadError = syncError;
|
||||
syncingWOrderId = null;
|
||||
}
|
||||
|
||||
async function refresh() {
|
||||
|
||||
Reference in New Issue
Block a user