Skip to content

Commit 1d90395

Browse files
committed
fix: minor tweaks
1 parent 2e9c300 commit 1d90395

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

web/src/app/api/publishers/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ export async function GET(): Promise<
6060

6161
const response: PublisherProfileResponse[] = await Promise.all(
6262
publishers.map(async ({ publisher, organization }) => {
63-
// Get agent count for this publisher
63+
// Get distinct agent count for this publisher (not including versions)
6464
const agentCount = await db
65-
.select({ count: schema.agentConfig.id })
65+
.selectDistinct({ id: schema.agentConfig.id })
6666
.from(schema.agentConfig)
6767
.where(eq(schema.agentConfig.publisher_id, publisher.id))
6868
.then((result) => result.length)

web/src/app/publishers/page.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { Skeleton } from '@/components/ui/skeleton'
99
import { Badge } from '@/components/ui/badge'
1010
import { User, Plus, ChevronRight } from 'lucide-react'
1111
import Link from 'next/link'
12+
import { pluralize } from '@codebuff/common/util/string'
1213
import type { PublisherProfileResponse } from '@codebuff/common/types/publisher'
1314

1415
const PublishersPage = () => {
@@ -139,7 +140,7 @@ const PublishersPage = () => {
139140
<Card>
140141
<CardHeader>
141142
<CardTitle className="flex items-center justify-between">
142-
<span>Personal Publishers ({personalPublishers.length})</span>
143+
<span>Personal Publishers</span>
143144
</CardTitle>
144145
</CardHeader>
145146
<CardContent>
@@ -201,7 +202,8 @@ const PublishersPage = () => {
201202
)}
202203
<div className="flex items-center space-x-4 text-sm text-muted-foreground">
203204
<span>
204-
{publisher.agentCount || 0} agents published
205+
{pluralize(publisher.agentCount || 0, 'agent')}{' '}
206+
published
205207
</span>
206208
<span>
207209
Created{' '}
@@ -224,9 +226,7 @@ const PublishersPage = () => {
224226
{orgPublishers.length > 0 && (
225227
<Card>
226228
<CardHeader>
227-
<CardTitle>
228-
Organization Publishers ({orgPublishers.length})
229-
</CardTitle>
229+
<CardTitle>Organization Publishers</CardTitle>
230230
</CardHeader>
231231
<CardContent>
232232
<div className="space-y-3">
@@ -260,7 +260,8 @@ const PublishersPage = () => {
260260
)}
261261
<div className="flex items-center space-x-4 text-sm text-muted-foreground">
262262
<span>
263-
{publisher.agentCount || 0} agents published
263+
{pluralize(publisher.agentCount || 0, 'agent')}{' '}
264+
published
264265
</span>
265266
<span>
266267
Created{' '}

0 commit comments

Comments
 (0)