Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Commit

Permalink
fix: delete duplicate calls for endpoint dependency (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fine0830 authored Sep 29, 2021
1 parent a040016 commit b578668
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/store/modules/profile/profile-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const actions = {
.query('queryServices')
.params(params)
.then((res: AxiosResponse) => {
context.commit(types.SET_PROFILE_ERRORS, { msg: 'serviceErrors', desc: res.data.errors || '' });
context.commit(types.SET_PROFILE_ERRORS, { msg: 'serviceProfileErrors', desc: res.data.errors || '' });
if (res.data.errors) {
return context.commit(types.SET_SERVICES, []);
}
Expand Down
11 changes: 9 additions & 2 deletions src/store/modules/topology/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ const actions: ActionTree<State, any> = {
.query('queryServices')
.params(params)
.then((res: AxiosResponse) => {
context.commit(types.SET_TOPO_ERRORS, { msg: 'serviceErrors', desc: res.data.errors });
context.commit(types.SET_TOPO_ERRORS, { msg: 'serviceTopoErrors', desc: res.data.errors });
if (res.data.errors) {
return [];
}
Expand Down Expand Up @@ -773,7 +773,7 @@ const actions: ActionTree<State, any> = {
return;
}
const topo = res.data.data;
const calls = [] as any;
let calls = [] as any;
let nodes = [] as any;
for (const key of Object.keys(topo)) {
calls.push(...topo[key].calls);
Expand All @@ -792,6 +792,13 @@ const actions: ActionTree<State, any> = {
}
return prev;
}, []);
calls = calls.reduce((prev: Call[], next: Call) => {
if (!obj[next.id]) {
obj[next.id] = true;
prev.push(next);
}
return prev;
}, []);
const queryVariables = ['$duration: Duration!'];
const fragments = calls
.map((call: Call & EndpointDependencyConidition, index: number) => {
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/trace/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const actions: ActionTree<State, any> = {
.query('queryServices')
.params(params)
.then((res: AxiosResponse) => {
context.commit(types.SET_TRACE_ERRORS, { msg: 'serviceError', desc: res.data.errors || '' });
context.commit(types.SET_TRACE_ERRORS, { msg: 'serviceTraceError', desc: res.data.errors || '' });
if (res.data.errors) {
context.commit(types.SET_SERVICES, []);
return;
Expand Down

0 comments on commit b578668

Please sign in to comment.