PunimTag Web Application - Major Feature Release #1

Open
tanyar09 wants to merge 106 commits from dev into master
Showing only changes of commit 1d35f4ab5a - Show all commits

View File

@ -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++;
}