mirror of
https://github.com/System-End/site.git
synced 2026-04-19 22:05:11 +00:00
record.id -> record["Name"]
This commit is contained in:
parent
ad511f35cb
commit
0c45788fa6
1 changed files with 4 additions and 3 deletions
|
|
@ -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 }
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue