From 2c7cb0074507f221282f9b54c51cc9a8792a9a3d Mon Sep 17 00:00:00 2001 From: aarbit Date: Tue, 19 May 2026 10:02:04 -0500 Subject: [PATCH] Lists all unreviewed photos for a hunt --- src/lib/api/index.ts | 3 + src/routes/admin/PhotoReview.svelte | 106 ++++++++++++++++++++++------ 2 files changed, 86 insertions(+), 23 deletions(-) diff --git a/src/lib/api/index.ts b/src/lib/api/index.ts index 31fa33f..2c544b9 100644 --- a/src/lib/api/index.ts +++ b/src/lib/api/index.ts @@ -104,6 +104,9 @@ export function photoUrl(photoId: string, version: 'ORIGINAL' | 'LARGE' | 'MEDIU export const apiReviewPhoto = (photoId: string, status: 'SUBMITTED' | 'APPROVED' | 'REJECTED' | 'REMOVED') => client.patch(`/admin/photo/${photoId}`, { status }) +export const apiGetUnreviewedPhotos = (huntId: string) => + client.get(`/admin/hunt/${huntId}/photo/unreviewed`) + // ── Stats ───────────────────────────────────────────────────────────────────── export const apiGetTeamLeaderboard = (huntId: string) => diff --git a/src/routes/admin/PhotoReview.svelte b/src/routes/admin/PhotoReview.svelte index 522a5ed..d94df8e 100644 --- a/src/routes/admin/PhotoReview.svelte +++ b/src/routes/admin/PhotoReview.svelte @@ -1,7 +1,7 @@ @@ -83,6 +101,7 @@ >
+

{photo.itemName}

{photo.hunterName} · {photo.teamName}

{parseUTC(photo.photoUploadDateTime).toLocaleString()}

@@ -148,14 +167,20 @@ {:else}
-

Select Item

+

+ {#if selectedItem} + Filtering by item — tap again to see all unreviewed + {:else} + Unreviewed ({activeUnreviewed.length}) + {/if} +

{#each items as item} @@ -164,6 +189,7 @@
{#if selectedItem} + {#if photosLoading} {:else if activePhotos.length === 0} @@ -172,7 +198,7 @@
{:else}
- {#each activePhotos as photo} + {#each activePhotos as photo (photo.id)}
{#if photo.photoStatus === 'SUBMITTED'}
- -
@@ -232,6 +250,48 @@ {/each}
{/if} + + {:else} + + {#if activeUnreviewed.length === 0} +
+

All caught up — no unreviewed photos!

+
+ {:else} +
+ {#each activeUnreviewed as photo (photo.id)} +
+ +
+

{photo.itemName}

+
+
+

{photo.hunterName} · {photo.teamName}

+

+ {parseUTC(photo.photoUploadDateTime).toLocaleString()} +

+
+ +
+
+ + +
+ +
+
+ {/each} +
+ {/if} {/if} {/if}