user agents

This commit is contained in:
Ben Wilson
2023-07-25 18:54:18 -04:00
parent e08de753b6
commit 3b583b3d67
5 changed files with 33 additions and 6 deletions
+10
View File
@@ -76,4 +76,14 @@ export class ClientService {
public async deleteAll() {
return await this.clientRepository.softDelete({})
}
public async getUserAgents() {
const result = await this.clientRepository.createQueryBuilder('client')
.select('client.userAgent as userAgent')
.addSelect('COUNT(client.userAgent)', 'count')
.groupBy('client.userAgent')
.orderBy('count', 'DESC')
.getRawMany();
return result;
}
}