record.id -> record["Name"]

This commit is contained in:
SkyfallWasTaken 2024-07-06 16:20:26 +01:00
parent ad511f35cb
commit 0c45788fa6

View file

@ -18,15 +18,16 @@ export const shopParts = async () => {
let stock = fields["Stock"]
if (stock) {
stock -= (await ordersTable.read({
await ordersTable.read({
filterByFormula: `AND(
{Item} = "${record.id}",
{Item} = "${record["Name"]}",
OR(
{Status} = "Fulfilled",
{Status} = "Awaiting Fulfillment"
)
)`
})).length;
})
stock -= records.length;
}
return { id: record.id, ...record.fields, "Stock": stock ?? null }
})