Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: look for slug instead of id #736

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ for message in consumer:
print(f"Received Inventory Adjusted event: {event_data}")
```

<Footer />
<Footer />
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
id: InventoryAdjusted
id: inventuryadjusted
name: Inventory adjusted
version: 0.0.1
summary: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ consumer = KafkaConsumer(
for message in consumer:
event_data = json.loads(message.value)
print(f"Received Inventory Adjusted event: {event_data}")
```
```
4 changes: 2 additions & 2 deletions src/utils/changelogs/changelogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { getCollection, type CollectionEntry } from 'astro:content';
export type ChangeLog = CollectionEntry<'changelogs'>;

export const getChangeLogs = async (item: CollectionEntry<CollectionTypes>): Promise<ChangeLog[]> => {
const { collection, data } = item;
const { collection, data, slug } = item;

// Get all logs for collection type and filter by given collection
const logs = await getCollection('changelogs', (log) => {
return log.id.includes(`${collection}/`) && log.id.includes(`/${data.id}/`);
return log.id.includes(`${collection}/`) && log.slug.includes(slug);
});

const hydratedLogs = logs.map((log) => {
Expand Down