@@ -19,7 +19,7 @@ export const BulkArchiveSelection = {
|
||||
docs: {
|
||||
description: {
|
||||
story:
|
||||
"The physical inventory section supports selecting active copies and archiving them in one authenticated operation.",
|
||||
"The physical inventory section supports selecting active copies for archive or asynchronous pricing refresh operations.",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
listAdminConditions,
|
||||
listAdminInventory,
|
||||
listAdminProducts,
|
||||
refreshAdminInventoryPricing,
|
||||
} from "@/services/admin-catalog-service.js";
|
||||
import {
|
||||
createAdminListing,
|
||||
@@ -213,6 +214,24 @@ async function archiveSelectedInventory() {
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshSelectedPricing() {
|
||||
if (!selectedInventoryIds.value.length) return;
|
||||
isSaving.value = true;
|
||||
try {
|
||||
const jobs = await refreshAdminInventoryPricing(
|
||||
selectedInventoryIds.value,
|
||||
pricingProvider.value,
|
||||
csrfToken(),
|
||||
);
|
||||
pricingJobs.value = [...jobs, ...pricingJobs.value];
|
||||
selectedInventoryIds.value = [];
|
||||
} catch (requestError) {
|
||||
error.value = requestError;
|
||||
} finally {
|
||||
isSaving.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function createListing() {
|
||||
const item = inventory.value.find(
|
||||
(candidate) => candidate.id === listingInventoryId.value,
|
||||
@@ -956,6 +975,14 @@ onMounted(load);
|
||||
>
|
||||
Archive selected
|
||||
</button>
|
||||
<button
|
||||
class="button button--secondary"
|
||||
type="button"
|
||||
:disabled="isSaving || !selectedInventoryIds.length"
|
||||
@click="refreshSelectedPricing"
|
||||
>
|
||||
Refresh pricing
|
||||
</button>
|
||||
</div>
|
||||
<p v-if="!inventory.length && !isLoading" class="state state--empty">
|
||||
No physical copies yet.
|
||||
|
||||
Reference in New Issue
Block a user