Skip to content

Commit

Permalink
fix: miragejs returns empty arrays (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
pyphilia authored Sep 13, 2023
1 parent 0971e00 commit 5beff49
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mockServer/mockServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const mockServer = ({
routes() {
// app data
this.get(`/${buildGetAppDataRoute(currentItem.id)}`, (schema) => {
return schema.all('appDataResource');
return schema.all('appDataResource') ?? [];
});
this.post(`/${buildPostAppDataRoute({ itemId: currentItem.id })}`, (schema, request) => {
if (!currentMember) {
Expand Down Expand Up @@ -222,7 +222,7 @@ export const mockServer = ({

// app actions
this.get(`/${buildGetAppActionsRoute(currentItem.id)}`, (schema) => {
return schema.all('appActionResource');
return schema.all('appActionResource') ?? [];
});
this.post(`/${buildPostAppActionRoute({ itemId: currentItem.id })}`, (schema, request) => {
const { requestBody } = request;
Expand All @@ -236,7 +236,7 @@ export const mockServer = ({

// app settings
this.get(`/${buildGetAppSettingsRoute(currentItem.id)}`, (schema) => {
return schema.all('appSetting');
return schema.all('appSetting') ?? [];
});

this.post(`/${buildPostAppSettingRoute({ itemId: currentItem.id })}`, (schema, request) => {
Expand Down

0 comments on commit 5beff49

Please sign in to comment.