Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #426 from beabee-communityrm/fix/missing-content
Browse files Browse the repository at this point in the history
fix: error on missing content
  • Loading branch information
wpf500 authored May 15, 2024
2 parents a5092e0 + 1981485 commit 2632c56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/transformers/ContentTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ class ContentTransformer {
}

async fetchOne<Id extends ContentId>(id: Id): Promise<GetContentDto<Id>> {
const content = await getRepository(Content).findOneByOrFail({ id });
const content = await getRepository(Content).findOneBy({ id });

const ret: Record<string, unknown> = {};

for (const [key, value] of Object.entries(contentData[id])) {
switch (value[0]) {
case "data":
ret[key] = content.data[key] || value[1];
ret[key] = content?.data[key] || value[1];
break;
case "option":
ret[key] = OptionsService[optTypeGetter[value[2]]](value[1]);
Expand Down

0 comments on commit 2632c56

Please sign in to comment.