From 196de2803286e1f2b6325092013805d7d256e8f2 Mon Sep 17 00:00:00 2001 From: robertsavian Date: Sat, 23 Jan 2021 07:35:59 -0600 Subject: [PATCH] update results --- src/components/pages/about-page/AboutPage.store.ts | 4 ++-- src/components/pages/index-page/IndexPage.store.ts | 8 ++++---- src/stores/auth/AuthGlobalStore.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/pages/about-page/AboutPage.store.ts b/src/components/pages/about-page/AboutPage.store.ts index bf669da..9729f4b 100644 --- a/src/components/pages/about-page/AboutPage.store.ts +++ b/src/components/pages/about-page/AboutPage.store.ts @@ -23,9 +23,9 @@ export class AboutPageStore { const response: ApiResponse = yield getErrorRequest(); this.errorExampleResults = { - ...this.errorExampleResults, - ...response, + data: this.errorExampleResults.data, isRequesting: false, + ...response, // Overwrites the default data prop or adds an error. Also adds the statusCode. }; if (response.error) { diff --git a/src/components/pages/index-page/IndexPage.store.ts b/src/components/pages/index-page/IndexPage.store.ts index c74006b..a1b1bdb 100644 --- a/src/components/pages/index-page/IndexPage.store.ts +++ b/src/components/pages/index-page/IndexPage.store.ts @@ -36,9 +36,9 @@ export const IndexPageStore = () => const response: ApiResponse = yield getShowRequest(defaultShowId); this.showResults = { - ...this.showResults, - ...response, + data: this.showResults.data, isRequesting: false, + ...response, // Overwrites the default data prop or adds an error. Also adds the statusCode. }; }, @@ -46,9 +46,9 @@ export const IndexPageStore = () => const response: ApiResponse = yield getCastsRequest(defaultShowId); this.castsResults = { - ...this.castsResults, - ...response, + data: this.castsResults.data, isRequesting: false, + ...response, // Overwrites the default data prop or adds an error. Also adds the statusCode. }; }, }); diff --git a/src/stores/auth/AuthGlobalStore.ts b/src/stores/auth/AuthGlobalStore.ts index 9dc06f9..b44f274 100644 --- a/src/stores/auth/AuthGlobalStore.ts +++ b/src/stores/auth/AuthGlobalStore.ts @@ -33,9 +33,9 @@ export const AuthGlobalStore = (globalStore: GlobalStore) => const response: ApiResponse = yield getUserRequest(); this.authResults = { - ...this.authResults, - ...response, + data: this.authResults.data, isRequesting: false, + ...response, // Overwrites the default data prop or adds an error. Also adds the statusCode. }; if (this.user) {