fix: settings widget fails because it expects list but gets null

This commit is contained in:
Vyrtsev Mikhail
2019-06-29 11:13:05 -05:00
committed by Umputun
parent 60d9f207ae
commit e5cc5e677b
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -220,7 +220,7 @@ export const unblockUser = (
withCredentials: true,
});
export const getBlocked = (): Promise<BlockedUser[]> =>
export const getBlocked = (): Promise<BlockedUser[] | null> =>
fetcher.get({
url: '/admin/blocked',
withCredentials: true,
+1 -1
View File
@@ -50,7 +50,7 @@ export const logout = (): StoreAction<Promise<void>> => async dispatch => {
};
export const fetchBlockedUsers = (): StoreAction<Promise<BlockedUser[]>> => async dispatch => {
const list = await api.getBlocked();
const list = (await api.getBlocked()) || [];
dispatch({
type: USER_BANLIST_SET,
list,