import { api } from "@/config";
import {
  API_GET_TRIP,
  API_HAUL_HANDLE,
  API_UPDATE_FISHING_LOGS,
  API_UPDATE_TRIP_STATUS,
} from "@/constants";

export async function queryTrip() {
  return api.get<Model.Trip>(API_GET_TRIP);
}

export async function queryUpdateTripState(body: Model.TripUpdateStateRequest) {
  return api.put(API_UPDATE_TRIP_STATUS, body);
}

export async function queryStartNewHaul(body: Model.NewFishingLogRequest) {
  return api.put(API_HAUL_HANDLE, body);
}

export async function queryUpdateFishingLogs(body: Model.FishingLog) {
  return api.put(API_UPDATE_FISHING_LOGS, body);
}