mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 20:59:02 +08:00
resets data to avoid multiple re-rendering for parallel apis
This commit is contained in:
parent
3318ec8c38
commit
fcc248ddf6
@ -38,6 +38,11 @@ export interface servicesAction {
|
|||||||
|
|
||||||
export const getServiceMapItems = (globalTime: GlobalTime) => {
|
export const getServiceMapItems = (globalTime: GlobalTime) => {
|
||||||
return async (dispatch: Dispatch) => {
|
return async (dispatch: Dispatch) => {
|
||||||
|
dispatch<serviceMapItemAction>({
|
||||||
|
type: ActionTypes.getServiceMapItems,
|
||||||
|
payload: [],
|
||||||
|
});
|
||||||
|
|
||||||
let request_string =
|
let request_string =
|
||||||
"/serviceMapDependencies?start=" +
|
"/serviceMapDependencies?start=" +
|
||||||
globalTime.minTime +
|
globalTime.minTime +
|
||||||
@ -45,7 +50,7 @@ export const getServiceMapItems = (globalTime: GlobalTime) => {
|
|||||||
globalTime.maxTime;
|
globalTime.maxTime;
|
||||||
|
|
||||||
const response = await api.get<servicesMapItem[]>(apiV1 + request_string);
|
const response = await api.get<servicesMapItem[]>(apiV1 + request_string);
|
||||||
|
|
||||||
dispatch<serviceMapItemAction>({
|
dispatch<serviceMapItemAction>({
|
||||||
type: ActionTypes.getServiceMapItems,
|
type: ActionTypes.getServiceMapItems,
|
||||||
payload: response.data,
|
payload: response.data,
|
||||||
@ -55,11 +60,16 @@ export const getServiceMapItems = (globalTime: GlobalTime) => {
|
|||||||
|
|
||||||
export const getDetailedServiceMapItems = (globalTime: GlobalTime) => {
|
export const getDetailedServiceMapItems = (globalTime: GlobalTime) => {
|
||||||
return async (dispatch: Dispatch) => {
|
return async (dispatch: Dispatch) => {
|
||||||
|
dispatch<servicesAction>({
|
||||||
|
type: ActionTypes.getServices,
|
||||||
|
payload: [],
|
||||||
|
});
|
||||||
|
|
||||||
let request_string =
|
let request_string =
|
||||||
"/services?start=" + globalTime.minTime + "&end=" + globalTime.maxTime;
|
"/services?start=" + globalTime.minTime + "&end=" + globalTime.maxTime;
|
||||||
|
|
||||||
const response = await api.get<servicesItem[]>(apiV1 + request_string);
|
const response = await api.get<servicesItem[]>(apiV1 + request_string);
|
||||||
|
|
||||||
dispatch<servicesAction>({
|
dispatch<servicesAction>({
|
||||||
type: ActionTypes.getServices,
|
type: ActionTypes.getServices,
|
||||||
payload: response.data,
|
payload: response.data,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user