mirror of
https://github.com/MAGICGrants/campaign-site.git
synced 2026-01-09 12:27:59 -05:00
fix(funding-required): correctly handle project_status ANY filter
This commit is contained in:
@@ -81,13 +81,15 @@ async function handle(
|
||||
const cacheKey = `${query.fund}-${query.asset}-${query.project_status}`
|
||||
const cachedResponse = cachedResponses[cacheKey]
|
||||
if (cachedResponse && cachedResponse.expiresAt > new Date()) {
|
||||
// return res.send(cachedResponse.data)
|
||||
return res.send(cachedResponse.data)
|
||||
}
|
||||
|
||||
const projects = (await getProjects(query.fund)).filter((project) =>
|
||||
query.project_status === 'ANY' || query.project_status === 'FUNDED'
|
||||
query.project_status === 'FUNDED'
|
||||
? project.isFunded
|
||||
: !project.isFunded
|
||||
: query.project_status === 'ANY'
|
||||
? true
|
||||
: !project.isFunded
|
||||
)
|
||||
|
||||
const rates: Record<string, number | undefined> = {}
|
||||
|
||||
Reference in New Issue
Block a user