Skip to content

Commit 795bf39

Browse files
committed
fix: bug with report on config tool names
1 parent 06ec26f commit 795bf39

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/routes/tools/[toolId]/+page.server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ export const actions: Actions = {
9797
envPublic.PUBLIC_SHARE_PREFIX || `${envPublic.PUBLIC_ORIGIN || url.origin}${base}`;
9898
const toolUrl = `${prefixUrl}/tools/${params.toolId}`;
9999

100-
const tool = await collections.tools.findOne<Pick<Tool, "displayName">>(
100+
const tool = await collections.tools.findOne<Pick<Tool, "displayName" | "name">>(
101101
{ _id: new ObjectId(params.toolId) },
102-
{ projection: { displayName: 1 } }
102+
{ projection: { displayName: 1, name: 1 } }
103103
);
104104

105105
const username = locals.user?.username;
106106

107107
await sendSlack(
108-
`🔴 Tool <${toolUrl}|${tool?.displayName}> reported by ${
108+
`🔴 Tool <${toolUrl}|${tool?.displayName ?? tool?.name}> reported by ${
109109
username ? `<http://hf.co/${username}|${username}>` : "non-logged in user"
110110
}.\n\n> ${result.data}`
111111
);

0 commit comments

Comments
 (0)