Skip to content

Commit

Permalink
Merge pull request #15 from fagbokforlaget/fix-rename-prop
Browse files Browse the repository at this point in the history
feat: add localizations field
  • Loading branch information
espresse authored Apr 3, 2024
2 parents 776391d + 623ad6a commit 87efe8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/content-fusion/content-fusion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export class ContentFusion {
const url = `${this.baseUrl}/content/${contentId}`;
const res = await new HttpClientProxy().get<Contents>(url);
if (locale) {
if (res?.localization?.[locale]) {
const localization = res.localization[locale];
if (res?.localizations?.[locale]) {
const localization = res.localizations[locale];
res.localization = {};
res.localization[locale] = localization;
} else {
Expand Down
1 change: 1 addition & 0 deletions src/content-fusion/dto/content-node-dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ export class Contents {
readonly updatedAt: string;
readonly id: string;
localization: Record<string, Localization>;
localizations: Record<string, Localization>;
readonly tags: Tag[];
}

0 comments on commit 87efe8f

Please sign in to comment.