Cập nhật tab Nhật ký ( CRUD chuyến đi, CRUD thuyền viên trong chuyến đi )
This commit is contained in:
@@ -9,12 +9,19 @@ import {
|
||||
API_POST_TRIP,
|
||||
API_PUT_TRIP,
|
||||
API_TRIP_CREW,
|
||||
API_GET_TRIP_BY_ID,
|
||||
API_TRIP_APPROVE_REQUEST,
|
||||
API_TRIP_CANCEL_REQUEST,
|
||||
} from "@/constants";
|
||||
|
||||
export async function queryTrip() {
|
||||
return api.get<Model.Trip>(API_GET_TRIP);
|
||||
}
|
||||
|
||||
export async function queryTripById(tripId: string) {
|
||||
return api.get<Model.Trip>(`${API_GET_TRIP_BY_ID}/${tripId}`);
|
||||
}
|
||||
|
||||
export async function queryLastTrip(thingId: string) {
|
||||
return api.get<Model.Trip>(`${API_GET_LAST_TRIP}/${thingId}`);
|
||||
}
|
||||
@@ -42,3 +49,11 @@ export async function createTrip(thingId: string, body: Model.TripAPIBody) {
|
||||
export async function updateTrip(tripId: string, body: Model.TripAPIBody) {
|
||||
return api.put<Model.Trip>(`${API_PUT_TRIP}/${tripId}`, body);
|
||||
}
|
||||
|
||||
export async function tripApproveRequest(tripId: string) {
|
||||
return api.put<Model.Trip>(`${API_TRIP_APPROVE_REQUEST}/${tripId}`);
|
||||
}
|
||||
|
||||
export async function tripCancelRequest(tripId: string) {
|
||||
return api.put<Model.Trip>(`${API_TRIP_CANCEL_REQUEST}/${tripId}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user