fix: settings widget fails because it expects list but gets null
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user