From 795bf391d3f267f69943403ee773461dc2c8749b Mon Sep 17 00:00:00 2001 From: Nathan Sarrazin Date: Mon, 13 Jan 2025 10:13:20 +0100 Subject: [PATCH] fix: bug with report on config tool names --- src/routes/tools/[toolId]/+page.server.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/tools/[toolId]/+page.server.ts b/src/routes/tools/[toolId]/+page.server.ts index 0d225f50f4b..7c6b3f57cef 100644 --- a/src/routes/tools/[toolId]/+page.server.ts +++ b/src/routes/tools/[toolId]/+page.server.ts @@ -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>( + const tool = await collections.tools.findOne>( { _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 ? `` : "non-logged in user" }.\n\n> ${result.data}` );