Merge branch 'origin/HEAD' into natsoni/more-fiat-currencies and fix db version conflicts

This commit is contained in:
natsoni
2024-03-11 15:32:35 +01:00
41 changed files with 229 additions and 40 deletions

View File

@@ -70,14 +70,26 @@ class AccelerationRepository {
JOIN pools on pools.unique_id = accelerations.pool
`;
let params: any[] = [];
let hasFilter = false;
if (interval) {
query += ` WHERE accelerations.added BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW() `;
} else if (height != null) {
query += ` WHERE accelerations.height = ? `;
hasFilter = true;
}
if (height != null) {
if (hasFilter) {
query += ` AND accelerations.height = ? `;
} else {
query += ` WHERE accelerations.height = ? `;
}
params.push(height);
} else if (poolSlug != null) {
query += ` WHERE pools.slug = ? `;
if (hasFilter) {
query += ` AND pools.slug = ? `;
} else {
query += ` WHERE pools.slug = ? `;
}
params.push(poolSlug);
}