fixes summit log author bug

This commit is contained in:
Christian Beutel
2024-12-04 22:53:11 +01:00
parent c42ca754df
commit 6a5783b2c5
2 changed files with 4 additions and 2 deletions

View File

@@ -75,7 +75,7 @@
{#if summitLogs.some((l) => l.text?.length)} {#if summitLogs.some((l) => l.text?.length)}
<th>{$_("description")}</th> <th>{$_("description")}</th>
{/if} {/if}
{#if showAuthor} {#if showAuthor && summitLogs.some(l => l.expand.author)}
<th> <th>
{$_("author", { values: { n: 1 } })} {$_("author", { values: { n: 1 } })}
</th> </th>

View File

@@ -25,7 +25,9 @@ export async function GET(event: RequestEvent) {
if (!log.expand) { if (!log.expand) {
log.expand = {} as any log.expand = {} as any
} }
log.expand.author = await pb.collection("users_anonymous").getOne(log.author!); if(log.author) {
log.expand.author = await pb.collection("users_anonymous").getOne(log.author);
}
} }
return json(r) return json(r)
} catch (e: any) { } catch (e: any) {