FIX: improved the visit card, cleanup the code
This commit is contained in:
parent
01c128e413
commit
dd45996f9c
22 changed files with 54 additions and 140 deletions
|
@ -1,22 +0,0 @@
|
|||
import {ADMIN_API_TOKEN, ADMIN_API_URL} from "../Enum/EnvironmentVariable";
|
||||
import Axios from "axios";
|
||||
|
||||
|
||||
class AdminApi {
|
||||
|
||||
fetchVisitCardUrl(membershipUuid: string): Promise<string> {
|
||||
if (ADMIN_API_URL) {
|
||||
return Axios.get(ADMIN_API_URL + '/api/membership/'+membershipUuid,
|
||||
{headers: {"Authorization": `${ADMIN_API_TOKEN}`}}
|
||||
).then((res) => {
|
||||
return res.data;
|
||||
}).catch(() => {
|
||||
return 'INVALID';
|
||||
});
|
||||
} else {
|
||||
return Promise.resolve('INVALID')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const adminApi = new AdminApi();
|
Loading…
Add table
Add a link
Reference in a new issue