Refine admin tag display

This commit is contained in:
Sam Becker 2023-10-05 23:34:58 -05:00
parent cddabc6180
commit 712c4ba6d3
2 changed files with 3 additions and 2 deletions

View File

@ -20,12 +20,13 @@ export default async function AdminPhotosPage() {
<AdminGrid>
{tags.map(({ tag, count }) =>
<Fragment key={tag}>
<div>
<div className="pr-2">
{tag}
</div>
<div className="text-dim">
{photoQuantityText(count, false)}
</div>
<div />
<FormWithConfirm
action={deletePhotoTagGloballyAction}
confirmText={

View File

@ -287,7 +287,7 @@ const sqlGetUniqueTags = async () => sql`
const sqlGetUniqueTagsWithCount = async () => sql`
SELECT DISTINCT unnest(tags) as tag, count(distinct id) as count FROM photos
GROUP BY tag
ORDER BY count ASC
ORDER BY count DESC
`.then(({ rows }) => rows.map(row => ({
tag: row.tag as string,
count: parseInt(row.count, 10),