feat: handle expired listings via expires_at, optimize polling to query only pending IDs, filter expired from public listings

This commit is contained in:
2026-02-07 09:58:30 +01:00
parent a3d2a3327a
commit 7505ce5555
3 changed files with 44 additions and 15 deletions

View File

@@ -327,6 +327,7 @@ class DirectusService {
'price',
'currency',
'condition',
'expires_at',
'date_created',
'user_created',
'images.directus_files_id.id',
@@ -341,7 +342,13 @@ class DirectusService {
'location.latitude',
'location.longitude'
],
filter: options.filter || { status: { _eq: 'published' } },
filter: options.filter || {
status: { _eq: 'published' },
_or: [
{ expires_at: { _null: true } },
{ expires_at: { _gt: '$NOW' } }
]
},
sort: options.sort || ['-date_created'],
limit: options.limit || 20,
page: options.page || 1