gonito-frontend/src/api/getFullUserInfo.js

16 lines
455 B
JavaScript

import { API } from '../utils/globals';
import KeyCloakService from '../services/KeyCloakService';
const getFullUser = async (setDataState, setLoadingState) => {
fetch(`${API}/full-user-info`, {
headers: { Authorization: `Bearer ${KeyCloakService.getToken()}` },
})
.then((response) => response.json())
.then((data) => {
setDataState(data);
if (setLoadingState) setLoadingState(false);
});
};
export default getFullUser;