refactor: replace drizzle count with $count (#2471)

This commit is contained in:
Meier Lukas
2025-03-02 10:54:44 +01:00
committed by GitHub
parent 9eb76634d0
commit d66610b324
5 changed files with 11 additions and 22 deletions

View File

@@ -1,4 +1,4 @@
import { and, count, like } from "@homarr/db";
import { and, like } from "@homarr/db";
import { icons } from "@homarr/db/schema";
import { validation } from "@homarr/validation";
@@ -24,7 +24,7 @@ export const iconsRouter = createTRPCRouter({
},
},
}),
countIcons: (await ctx.db.select({ count: count() }).from(icons))[0]?.count ?? 0,
countIcons: await ctx.db.$count(icons),
};
}),
});