Skip to content

Commit 2593cc0

Browse files
chore: use common message
1 parent f3d8538 commit 2593cc0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/tools/mongodb/delete/dropIndex.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ export class DropIndexTool extends MongoDBToolBase {
2525

2626
return {
2727
content: formatUntrustedData(
28-
`${result.ok ? "Successfully dropped" : "Failed to drop"} the index.`,
28+
`${result.ok ? "Successfully dropped" : "Failed to drop"} the index from the provided namespace.`,
2929
JSON.stringify({
3030
indexName,
31+
namespace: `${database}.${collection}`,
3132
})
3233
),
3334
isError: result.ok ? undefined : true,

tests/integration/tools/mongodb/delete/dropIndex.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ describeWithMongoDB("drop-index tool", (integration) => {
106106
});
107107
expect(response.isError).toBe(undefined);
108108
const content = getResponseContent(response.content);
109-
expect(content).toContain(`Successfully dropped the index.`);
109+
expect(content).toContain(`Successfully dropped the index from the provided namespace.`);
110110
const data = getDataFromUntrustedContent(content);
111-
expect(JSON.parse(data)).toMatchObject({ indexName });
111+
expect(JSON.parse(data)).toMatchObject({ indexName, namespace: "mflix.movies" });
112112
});
113113
});
114114
});

0 commit comments

Comments
 (0)