No loading bars for cards, no failure if it 404s (that's expected)
This commit is contained in:
parent
f0de621e76
commit
c8e4b9c663
|
@ -11,6 +11,11 @@ export function fetchStatusCard(id) {
|
||||||
api(getState).get(`/api/v1/statuses/${id}/card`).then(response => {
|
api(getState).get(`/api/v1/statuses/${id}/card`).then(response => {
|
||||||
dispatch(fetchStatusCardSuccess(id, response.data));
|
dispatch(fetchStatusCardSuccess(id, response.data));
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
if (error.response.status === 404) {
|
||||||
|
// This is fine
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
dispatch(fetchStatusCardFail(id, error));
|
dispatch(fetchStatusCardFail(id, error));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -19,7 +24,8 @@ export function fetchStatusCard(id) {
|
||||||
export function fetchStatusCardRequest(id) {
|
export function fetchStatusCardRequest(id) {
|
||||||
return {
|
return {
|
||||||
type: STATUS_CARD_FETCH_REQUEST,
|
type: STATUS_CARD_FETCH_REQUEST,
|
||||||
id
|
id,
|
||||||
|
skipLoading: true
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -27,7 +33,8 @@ export function fetchStatusCardSuccess(id, card) {
|
||||||
return {
|
return {
|
||||||
type: STATUS_CARD_FETCH_SUCCESS,
|
type: STATUS_CARD_FETCH_SUCCESS,
|
||||||
id,
|
id,
|
||||||
card
|
card,
|
||||||
|
skipLoading: true
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,6 +42,7 @@ export function fetchStatusCardFail(id, error) {
|
||||||
return {
|
return {
|
||||||
type: STATUS_CARD_FETCH_FAIL,
|
type: STATUS_CARD_FETCH_FAIL,
|
||||||
id,
|
id,
|
||||||
error
|
error,
|
||||||
|
skipLoading: true
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue