Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce4842f375 |
@@ -49,7 +49,7 @@ export async function GET(req: MedusaRequest, res: MedusaResponse) {
|
||||
const variant = product.variants?.[0];
|
||||
const inventoryItem = variant?.inventory_items?.[0];
|
||||
const level = inventoryItem?.inventory?.location_levels?.find(
|
||||
(level: { location_id: string }) => level.location_id === locationId,
|
||||
(candidate) => candidate?.location_id === locationId,
|
||||
);
|
||||
return {
|
||||
productId: product.id,
|
||||
@@ -131,7 +131,7 @@ export async function POST(req: MedusaRequest<PanelUpdateBody>, res: MedusaRespo
|
||||
}
|
||||
if (typeof quantity === "number" && inventoryItemId) {
|
||||
const level = inventoryItem?.inventory?.location_levels?.find(
|
||||
(level: { location_id: string }) => level.location_id === locationId,
|
||||
(candidate) => candidate?.location_id === locationId,
|
||||
);
|
||||
await updateInventoryLevelsWorkflow(req.scope).run({
|
||||
input: {
|
||||
|
||||
Reference in new issue
Block a user