mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +01:00
use new created error to fix test
This commit is contained in:
@@ -2,10 +2,7 @@
|
|||||||
import type { Me } from "@scm-manager/ui-types";
|
import type { Me } from "@scm-manager/ui-types";
|
||||||
import * as types from "./types";
|
import * as types from "./types";
|
||||||
|
|
||||||
import {
|
import { apiClient, UNAUTHORIZED_ERROR } from "@scm-manager/ui-components";
|
||||||
apiClient,
|
|
||||||
UNAUTHORIZED_ERROR_MESSAGE
|
|
||||||
} from "@scm-manager/ui-components";
|
|
||||||
import { isPending } from "./pending";
|
import { isPending } from "./pending";
|
||||||
import { getFailure } from "./failure";
|
import { getFailure } from "./failure";
|
||||||
import {
|
import {
|
||||||
@@ -190,7 +187,7 @@ export const fetchMe = (link: string) => {
|
|||||||
dispatch(fetchMeSuccess(me));
|
dispatch(fetchMeSuccess(me));
|
||||||
})
|
})
|
||||||
.catch((error: Error) => {
|
.catch((error: Error) => {
|
||||||
if (error.message === UNAUTHORIZED_ERROR_MESSAGE) {
|
if (error === UNAUTHORIZED_ERROR) {
|
||||||
dispatch(fetchMeUnauthenticated());
|
dispatch(fetchMeUnauthenticated());
|
||||||
} else {
|
} else {
|
||||||
dispatch(fetchMeFailure(error));
|
dispatch(fetchMeFailure(error));
|
||||||
|
|||||||
Reference in New Issue
Block a user