feat: handle expired listings via expires_at, optimize polling to query only pending IDs, filter expired from public listings
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user