Skip to content

Commit

Permalink
fix(guide): pass relevant resource type through algolia response fct
Browse files Browse the repository at this point in the history
  • Loading branch information
almostSouji committed Jul 27, 2024
1 parent 121965b commit 0fc770f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/functions/algoliaResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export async function algoliaResponse(
emojiName: string,
user?: string,
ephemeral?: boolean,
type = 'documentation',
): Promise<Response> {
const full = `http://${algoliaAppId}.${API_BASE_ALGOLIA}/1/indexes/${algoliaIndex}/${encodeURIComponent(
expandAlgoliaObjectId(algoliaObjectId),
Expand Down Expand Up @@ -51,7 +52,7 @@ export async function algoliaResponse(

prepareResponse(res, contentParts.join('\n'), {
ephemeral,
suggestion: user ? { userId: user, kind: 'documentation' } : undefined,
suggestion: user ? { userId: user, kind: type } : undefined,
});
} catch {
prepareErrorResponse(res, 'Invalid result. Make sure to select an entry from the autocomplete.');
Expand Down
2 changes: 1 addition & 1 deletion src/handling/handleApplicationCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export async function handleApplicationCommand(

case 'dtypes': {
const castArgs = args as ArgumentsOf<typeof DTypesCommand>;

await algoliaResponse(
res,
process.env.DTYPES_ALGOLIA_APP!,
Expand Down Expand Up @@ -108,6 +107,7 @@ export async function handleApplicationCommand(
'guide',
castArgs.mention,
castArgs.hide,
'guide',
);
break;
}
Expand Down

0 comments on commit 0fc770f

Please sign in to comment.