Fix query, yet again

This commit is contained in:
SkyfallWasTaken 2024-07-06 16:48:58 +01:00
parent ed13ee4c76
commit 3b530be9db

View file

@ -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 }