thêm chức năng Sos và thêm glustack-ui
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
API_GET_GPS,
|
||||
API_PATH_ENTITIES,
|
||||
API_PATH_SHIP_TRACK_POINTS,
|
||||
API_SOS,
|
||||
} from "@/constants";
|
||||
import { transformEntityResponse } from "@/utils/tranform";
|
||||
|
||||
@@ -23,3 +24,14 @@ export async function queryEntities(): Promise<Model.TransformedEntity[]> {
|
||||
const response = await api.get<Model.EntityResponse[]>(API_PATH_ENTITIES);
|
||||
return response.data.map(transformEntityResponse);
|
||||
}
|
||||
|
||||
export async function queryGetSos() {
|
||||
return await api.get<Model.SosResponse>(API_SOS);
|
||||
}
|
||||
export async function queryDeleteSos() {
|
||||
return await api.delete<Model.SosResponse>(API_SOS);
|
||||
}
|
||||
|
||||
export async function querySendSosMessage(message: string) {
|
||||
return await api.put<Model.SosRequest>(API_SOS, { message });
|
||||
}
|
||||
|
||||
10
controller/typings.d.ts
vendored
10
controller/typings.d.ts
vendored
@@ -80,4 +80,14 @@ declare namespace Model {
|
||||
geom_point?: string;
|
||||
geom_radius?: number;
|
||||
}
|
||||
|
||||
interface SosRequest {
|
||||
message?: string;
|
||||
}
|
||||
|
||||
interface SosResponse {
|
||||
active: boolean;
|
||||
message?: string;
|
||||
started_at?: number;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user