Skip to content

Commit

Permalink
fix: bug with report on config tool names
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarrazin committed Jan 13, 2025
1 parent 06ec26f commit 795bf39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/routes/tools/[toolId]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ export const actions: Actions = {
envPublic.PUBLIC_SHARE_PREFIX || `${envPublic.PUBLIC_ORIGIN || url.origin}${base}`;
const toolUrl = `${prefixUrl}/tools/${params.toolId}`;

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

const username = locals.user?.username;

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

0 comments on commit 795bf39

Please sign in to comment.