cập nhật modal CRUD thuyền viên trong trip

This commit is contained in:
2025-12-24 21:58:18 +07:00
parent 24847504b1
commit 190e44b09e
13 changed files with 822 additions and 68 deletions

View File

@@ -1,12 +1,27 @@
import { api } from "@/config";
import { API_GET_PHOTO, API_GET_TRIP_CREW } from "@/constants";
import {
API_GET_PHOTO,
API_GET_TRIP_CREW,
API_SEARCH_CREW,
API_TRIP_CREW,
} from "@/constants";
export async function queryTripCrew(tripId: string) {
return api.get<Model.TripCrews[]>(`${API_GET_TRIP_CREW}/${tripId}`);
}
export async function queryCrewImage(personal_id: string) {
return await api.get(`${API_GET_PHOTO}/people/${personal_id}/main`, {
responseType: "arraybuffer",
});
export async function searchCrew(personal_id: string) {
return api.get<Model.TripCrewPerson>(`${API_SEARCH_CREW}/${personal_id}`);
}
export async function newTripCrew(body: Model.NewTripCrewAPIRequest) {
return api.post(API_TRIP_CREW, body);
}
export async function updateTripCrew(body: Model.UpdateTripCrewAPIRequest) {
return api.put(API_TRIP_CREW, body);
}
export async function deleteTripCrew(tripId: string, personalId: string) {
return api.delete(`${API_TRIP_CREW}/${tripId}/${personalId}`);
}