Skip to content

Commit

Permalink
fix: fix response not in json form (#680)
Browse files Browse the repository at this point in the history
Update myriad.service.ts
  • Loading branch information
RiXelanya authored Nov 21, 2023
1 parent 4082f69 commit b2a2ede
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/endpoints/myriad/myriad.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ export class MyriadService {
data,
config,
);
console.log(res.data);
return res.data;
}

Expand Down Expand Up @@ -489,12 +490,16 @@ export class MyriadService {
filter: filter,
},
});
const data: any[] = res.data;
const data: any[] = res.data?.data ?? [];
if (data.length === 0) {
const experience = await this.createMyriadExperience(user, jwt);
return experience.id;
return {
id: experience.id,
};
} else {
return data[0].experience.id;
return {
id: data[0].experienceId,
};
}
} catch (err) {
this.logger.error(err);
Expand Down

0 comments on commit b2a2ede

Please sign in to comment.