fix(types): Add REVOKED to VisitorLog status and include revoke method in visitorsApi
This commit is contained in:
parent
9f41d6b413
commit
26c2680b64
1 changed files with 6 additions and 1 deletions
|
|
@ -18,7 +18,7 @@ export interface Visitor {
|
||||||
export interface VisitorLog {
|
export interface VisitorLog {
|
||||||
id: string;
|
id: string;
|
||||||
visitorId: string;
|
visitorId: string;
|
||||||
status: 'PRE_REGISTERED' | 'CHECKED_IN' | 'CHECKED_OUT' | 'DENIED';
|
status: 'PRE_REGISTERED' | 'CHECKED_IN' | 'CHECKED_OUT' | 'DENIED' | 'REVOKED';
|
||||||
entryTime: string;
|
entryTime: string;
|
||||||
exitTime?: string;
|
exitTime?: string;
|
||||||
escortId?: string;
|
escortId?: string;
|
||||||
|
|
@ -95,6 +95,11 @@ export const visitorsApi = {
|
||||||
return response.data;
|
return response.data;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async revoke(id: string, notes: string): Promise<{ success: boolean; log: VisitorLog }> {
|
||||||
|
const response = await api.post(`/api/visitors/${id}/revoke`, { notes });
|
||||||
|
return response.data;
|
||||||
|
},
|
||||||
|
|
||||||
async getReport(params: { startDate?: string; endDate?: string; type?: string }): Promise<any> {
|
async getReport(params: { startDate?: string; endDate?: string; type?: string }): Promise<any> {
|
||||||
const response = await api.get('/api/visitors/report', { params });
|
const response = await api.get('/api/visitors/report', { params });
|
||||||
return response.data;
|
return response.data;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue