PunimTag Web Application - Major Feature Release #1
@ -171,12 +171,14 @@ export async function GET(request: NextRequest) {
|
||||
|
||||
if (dateFrom || dateTo) {
|
||||
if (dateFrom) {
|
||||
whereConditions.push(`date_taken >= $${paramIndex}`);
|
||||
// Cast param to DATE to avoid "operator does not exist: date >= text" in Postgres
|
||||
whereConditions.push(`date_taken >= $${paramIndex}::date`);
|
||||
params.push(dateFrom);
|
||||
paramIndex++;
|
||||
}
|
||||
if (dateTo) {
|
||||
whereConditions.push(`date_taken <= $${paramIndex}`);
|
||||
// Cast param to DATE to avoid "operator does not exist: date <= text" in Postgres
|
||||
whereConditions.push(`date_taken <= $${paramIndex}::date`);
|
||||
params.push(dateTo);
|
||||
paramIndex++;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user