You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we are trying to follow some of the links out of state and very first time when the page loads those links are not trigrring api call.
const refreshStore = (franchiseId: string, storeId: string) => {
franchiseGroupClient.get(franchiseId).then(response => setFranchiseGroup(response));
storeClient.get(franchiseId, storeId, true).then(({ data, state }) => {
if (state.links.has('region')) regionClient.fromResource(state.follow('region')).then(setRegion);
if (state.links.has('area')) areaClient.fromResource(state.follow('area')).then(setArea);
if (state.links.has('close')) setStoreCloseURL(state.links.get('close')!.href);
if (state.links.has('open')) setStoreOpenURL(state.links.get('open')!.href);
if (state.links.has('reopen')) setStoreReopenURL(state.links.get('reopen')!.href);
if (state.links.has('finalize')) setStoreFinalizeURL(state.links.get('finalize')!.href);
if (state.links.has('abandon')) setAbandonStoreURL(state.links.get('abandon')!.href);
setStore(data);
});
storeClient.assignments(storeId).then(setTeamRoster);
};
this is our fromREsource
fromResource = async (resource: Resource): Promise => resource.get().then(this.fromState);
abstract fromState(state: State): Promise;
so in regionClient.fromResource(state.follow('region')).then(setRegion); we are trying to follow the region link but at the pagload time it is not calling the api but when we refresh the page, api call is getting triggered..
COuld you please help me to call the api first time (at the page load only).. why after refresh it calls the api?
The text was updated successfully, but these errors were encountered:
Hi @evert
we are trying to follow some of the links out of state and very first time when the page loads those links are not trigrring api call.
const refreshStore = (franchiseId: string, storeId: string) => {
franchiseGroupClient.get(franchiseId).then(response => setFranchiseGroup(response));
storeClient.get(franchiseId, storeId, true).then(({ data, state }) => {
if (state.links.has('region')) regionClient.fromResource(state.follow('region')).then(setRegion);
if (state.links.has('area')) areaClient.fromResource(state.follow('area')).then(setArea);
if (state.links.has('close')) setStoreCloseURL(state.links.get('close')!.href);
if (state.links.has('open')) setStoreOpenURL(state.links.get('open')!.href);
if (state.links.has('reopen')) setStoreReopenURL(state.links.get('reopen')!.href);
if (state.links.has('finalize')) setStoreFinalizeURL(state.links.get('finalize')!.href);
if (state.links.has('abandon')) setAbandonStoreURL(state.links.get('abandon')!.href);
setStore(data);
});
storeClient.assignments(storeId).then(setTeamRoster);
};
this is our fromREsource
fromResource = async (resource: Resource): Promise => resource.get().then(this.fromState);
abstract fromState(state: State): Promise;
so in regionClient.fromResource(state.follow('region')).then(setRegion); we are trying to follow the region link but at the pagload time it is not calling the api but when we refresh the page, api call is getting triggered..
COuld you please help me to call the api first time (at the page load only).. why after refresh it calls the api?
The text was updated successfully, but these errors were encountered: