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!

a few small improvements

Blue Mouse636f14d9879e
diff --git a/apps/production/src/analytics/analytics.service.ts b/apps/production/src/analytics/analytics.service.ts
index 07e961e20..ec8df530c 100644
--- a/apps/production/src/analytics/analytics.service.ts
+++ b/apps/production/src/analytics/analytics.service.ts
@@ -789,9 +789,9 @@ export class AnalyticsService {
}
async getFilters(pid: string, type: string): Promise<Array<string>> {
- const query = `SELECT ${type} FROM analytics WHERE pid={pid:FixedString(12)} AND ${type} IS NOT NULL GROUP BY ${type}`
+ const query = `SELECT {type:String} FROM analytics WHERE pid={pid:FixedString(12)} AND {type:String} IS NOT NULL GROUP BY {type:String}`
const results = await clickhouse
- .query(query, { params: { pid } })
+ .query(query, { params: { pid, type } })
.toPromise()
return _map(results, type)
diff --git a/apps/production/src/project/project.controller.ts b/apps/production/src/project/project.controller.ts
index bffcc056c..58a99ca18 100644
--- a/apps/production/src/project/project.controller.ts
+++ b/apps/production/src/project/project.controller.ts
@@ -630,10 +630,10 @@ export class ProjectController {
throw new NotFoundException('Project not found')
}
- const filters = JSON.parse(rawFilters)
-
this.projectService.allowedToManage(project, uid)
+ const filters = JSON.parse(rawFilters)
+
await Promise.all([
..._map(filters, async (filter: string) => {
this.projectService.deleteByFilter(pid, type, filter)