Skip to content

Commit

Permalink
fix(core): ubiquitous lang now renders on domains (#1054)
Browse files Browse the repository at this point in the history
* fix(core): ubiquitous lang now renders on domains

* Create swift-meals-sip.md
  • Loading branch information
boyney123 authored Dec 19, 2024
1 parent b4fed00 commit 6f5746b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/swift-meals-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@eventcatalog/core": patch
---

fix(core): ubiquitous lang now renders on domains
12 changes: 6 additions & 6 deletions eventcatalog/src/utils/collections/domains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ let cachedDomains: Record<string, Domain[]> = {
export const getDomains = async ({ getAllVersions = true }: Props = {}): Promise<Domain[]> => {
const cacheKey = getAllVersions ? 'allVersions' : 'currentVersions';

// Check if we have cached domains for this specific getAllVersions value
if (cachedDomains[cacheKey].length > 0) {
return cachedDomains[cacheKey];
}
// // Check if we have cached domains for this specific getAllVersions value
// if (cachedDomains[cacheKey].length > 0) {
// return cachedDomains[cacheKey];
// }

// Get all the domains that are not versioned
const domains = await getCollection('domains', (domain) => {
Expand Down Expand Up @@ -69,10 +69,10 @@ export const getDomains = async ({ getAllVersions = true }: Props = {}): Promise
};

export const getUbiquitousLanguage = async (domain: Domain): Promise<UbiquitousLanguage[]> => {
const { collection, data, slug } = domain;
const { collection, data } = domain;

const ubiquitousLanguages = await getCollection('ubiquitousLanguages', (ubiquitousLanguage) => {
return ubiquitousLanguage.id.includes(`${collection}/${data.name}`);
return ubiquitousLanguage.id.toLowerCase().includes(`${collection}/${data.name}`.toLowerCase());
});

return ubiquitousLanguages;
Expand Down

0 comments on commit 6f5746b

Please sign in to comment.