Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Update apps/production/src/project/project.service.ts

Maksim Mrugfbf0c758bb89
diff --git a/apps/production/src/project/project.service.ts b/apps/production/src/project/project.service.ts
index 8b26066f0..b37731347 100644
--- a/apps/production/src/project/project.service.ts
+++ b/apps/production/src/project/project.service.ts
@@ -517,16 +517,18 @@ export class ProjectService {
}
}
- async resetFilters(
+ async deleteByFilter(
pid: string,
type: string,
- filters: string,
+ filter: string,
): Promise<void> {
- const query = `DELETE FROM analytics WHERE pid='${pid}' AND ${type}='${filters}';`
+ const query = `DELETE FROM analytics WHERE pid={pid:FixedString(12)} AND {type:String}={filter:String};`
+ const params = {
+ pid, type, filter,
+ }
- await clickhouse.query(query, { params: { pid } }).toPromise()
+ await clickhouse.query(query, { params }).toPromise()
}
-
async removeDataFromClickhouse(
pid: string,
from: string,