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

Commit

Permalink
fix(composable): attach entire error object in useCms:search (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkucmus authored Feb 5, 2020
1 parent ff1836a commit 84bca64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/composables/__tests__/useCms.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe("Shopware composables", () => {
await search();
expect(page.value).toEqual(null);
expect(error.value).toBeTruthy();
expect(error.value).toEqual("Something went wrong...");
expect(error.value).toStrictEqual({ message: "Something went wrong..." });
});

it("should performs search request with no or empty configuration for SearchCriteria", async () => {
Expand All @@ -64,7 +64,7 @@ describe("Shopware composables", () => {
await search("", { configuration: { associations: [] } });
expect(page.value).toEqual(null);
expect(error.value).toBeTruthy();
expect(error.value).toEqual("Something went wrong...");
expect(error.value).toStrictEqual({ message: "Something went wrong..." });
});

it("should return activeCategoryId if it's included within the page object", async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/composables/src/hooks/useCms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const useCms = (): any => {
vuexStore.commit("SET_PAGE", result);
} catch (e) {
const err: ClientApiError = e;
error.value = err.message;
error.value = err;
console.error("Problem with fetching CMS data: ", err.message);
} finally {
loading.value = false;
Expand Down

1 comment on commit 84bca64

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for website ready!

Built with commit d645103

https://shopware-pwa-2bsitcq32.now.sh

Please sign in to comment.