diff --git a/frontend/src/lib/directus.ts b/frontend/src/lib/directus.ts index 2c661df..66342be 100644 --- a/frontend/src/lib/directus.ts +++ b/frontend/src/lib/directus.ts @@ -241,17 +241,15 @@ export async function getArtworks(options?: { forSale?: boolean; }): Promise { // When forSale is true, build a compound filter requiring: - // - name set, image set, and at least one price (GBP or USD) > 0 - // This means artworks automatically appear in the store once their - // required fields are populated, and disappear when status changes to sold/archived. + // - name set, image uploaded, and GBP price set (> 0) + // Setting a GBP price is the signal that an artwork is for sale. + // Artworks automatically appear in the store once these fields are populated + // in Directus, and move to sold section when status changes to 'sold'. if (options?.forSale) { const conditions: Record[] = [ { name: { _nnull: true, _nempty: true } }, { image: { _nnull: true } }, - { _or: [ - { price_gbp: { _gt: 0 } }, - { price_usd: { _gt: 0 } }, - ]}, + { price_gbp: { _gt: 0 } }, ]; if (options?.status) conditions.push({ status: { _eq: options.status } }); if (options?.series) conditions.push({ series: { _eq: options.series } });