more fixes
This commit is contained in:
parent
5e54fc2c26
commit
c5f8b43fec
3 changed files with 26 additions and 12 deletions
|
@ -1,5 +1,5 @@
|
|||
import {ADMIN_API_TOKEN, ADMIN_API_URL} from "../Enum/EnvironmentVariable";
|
||||
import Axios from "axios";
|
||||
import Axios, {AxiosError} from "axios";
|
||||
|
||||
export interface AdminApiData {
|
||||
organizationSlug: string
|
||||
|
@ -26,10 +26,15 @@ class AdminApi {
|
|||
if (!ADMIN_API_URL) {
|
||||
return Promise.reject('No admin backoffice set!');
|
||||
}
|
||||
const res = await Axios.get(ADMIN_API_URL+'/api/member/'+memberId+'/is-granted-access/'+roomId,
|
||||
{ headers: {"Authorization" : `${ADMIN_API_TOKEN}`} }
|
||||
)
|
||||
return res.data === true;
|
||||
try {
|
||||
const res = await Axios.get(ADMIN_API_URL+'/api/member/is-granted-access',
|
||||
{ headers: {"Authorization" : `${ADMIN_API_TOKEN}`}, params: {memberId, roomIdentifier: roomId} }
|
||||
)
|
||||
return !!res.data;
|
||||
} catch (e) {
|
||||
console.log(e.message)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue