fixes summit log author bug
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user