fixes summit log author bug
This commit is contained in:
@@ -75,7 +75,7 @@
|
||||
{#if summitLogs.some((l) => l.text?.length)}
|
||||
<th>{$_("description")}</th>
|
||||
{/if}
|
||||
{#if showAuthor}
|
||||
{#if showAuthor && summitLogs.some(l => l.expand.author)}
|
||||
<th>
|
||||
{$_("author", { values: { n: 1 } })}
|
||||
</th>
|
||||
|
||||
@@ -25,7 +25,9 @@ export async function GET(event: RequestEvent) {
|
||||
if (!log.expand) {
|
||||
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)
|
||||
} catch (e: any) {
|
||||
|
||||
Reference in New Issue
Block a user