import { api } from "@/config"; import { API_GET_ALL_SHIP, API_GET_PHOTO, API_GET_SHIP_GROUPS, API_GET_SHIP_TYPES, API_PATH_SEARCH_THINGS, } from "@/constants"; export async function querySearchThings(body: Model.SearchThingBody) { return await api.post(API_PATH_SEARCH_THINGS, body); } export async function queryShipTypes() { return await api.get(API_GET_SHIP_TYPES); } export async function queryShipGroups() { return await api.get(API_GET_SHIP_GROUPS); } export async function queryAllShips(params: Model.SearchThingBody) { return await api.get(API_GET_ALL_SHIP, { params: params, }); } export async function queryShipsImage(ship_id: string) { return await api.get(`${API_GET_PHOTO}/ship/${ship_id}/main`, { responseType: "arraybuffer", }); } export async function queryUpdateShip( shipId: string, body: Model.ShipBodyRequest ) { return await api.put(`${API_GET_ALL_SHIP}/${shipId}`, body); }