mirror of
https://github.com/System-End/site.git
synced 2026-04-19 23:22:49 +00:00
Fix query, yet again
This commit is contained in:
parent
ed13ee4c76
commit
3b530be9db
1 changed files with 9 additions and 4 deletions
|
|
@ -19,10 +19,15 @@ export const shopParts = async () => {
|
|||
|
||||
if (stock) {
|
||||
stock -= (await ordersTable.read({
|
||||
filterByFormula: `OR(
|
||||
{Status} = "Fulfilled",
|
||||
{Status} = "Awaiting Fulfillment"
|
||||
)`
|
||||
filterByFormula: `
|
||||
AND(
|
||||
RECORD_ID(Item) = '${record.id}',
|
||||
OR(
|
||||
{Status} = 'Fulfilled',
|
||||
{Status} = 'Awaiting Fulfillment'
|
||||
)
|
||||
)
|
||||
`
|
||||
})).length;
|
||||
}
|
||||
return { id: record.id, ...record.fields, "Stock": stock ?? null }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue