From be3a5c1380137b1b8a0faa2f1f6ec9e704ca0bd9 Mon Sep 17 00:00:00 2001 From: Benjamin Otto Date: Tue, 14 Jan 2025 13:23:19 +0100 Subject: [PATCH] Check if slug is included within slashes (#1094) * check if it includes only the slug * Create tasty-goats-jump.md --------- Co-authored-by: David Boyne --- .changeset/tasty-goats-jump.md | 5 +++++ eventcatalog/src/utils/collections/changelogs.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/tasty-goats-jump.md diff --git a/.changeset/tasty-goats-jump.md b/.changeset/tasty-goats-jump.md new file mode 100644 index 00000000..37937046 --- /dev/null +++ b/.changeset/tasty-goats-jump.md @@ -0,0 +1,5 @@ +--- +"@eventcatalog/core": patch +--- + +fix(core): fixed issue where changelog page would show the wrong information diff --git a/eventcatalog/src/utils/collections/changelogs.ts b/eventcatalog/src/utils/collections/changelogs.ts index 4ec48809..cdda6526 100644 --- a/eventcatalog/src/utils/collections/changelogs.ts +++ b/eventcatalog/src/utils/collections/changelogs.ts @@ -8,7 +8,7 @@ export const getChangeLogs = async (item: CollectionEntry): Pro // Get all logs for collection type and filter by given collection const logs = await getCollection('changelogs', (log) => { - return log.id.includes(`${collection}/`) && log.slug.includes(slug); + return log.id.includes(`${collection}/`) && log.slug.includes('/' + slug + '/'); }); const hydratedLogs = logs.map((log) => {