thêm toast, thêm logic cho phần ButtonCreateNewHaulOrTrip
This commit is contained in:
@@ -9,7 +9,7 @@ import {
|
||||
import { transformEntityResponse } from "@/utils/tranform";
|
||||
|
||||
export async function queryGpsData() {
|
||||
return api.get<Model.GPSResonse>(API_GET_GPS);
|
||||
return api.get<Model.GPSResponse>(API_GET_GPS);
|
||||
}
|
||||
|
||||
export async function queryAlarm() {
|
||||
|
||||
@@ -1,6 +1,18 @@
|
||||
import { api } from "@/config";
|
||||
import { API_GET_TRIP } from "@/constants";
|
||||
import {
|
||||
API_GET_TRIP,
|
||||
API_HAUL_HANDLE,
|
||||
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);
|
||||
}
|
||||
|
||||
14
controller/typings.d.ts
vendored
14
controller/typings.d.ts
vendored
@@ -7,7 +7,7 @@ declare namespace Model {
|
||||
token?: string;
|
||||
}
|
||||
|
||||
interface GPSResonse {
|
||||
interface GPSResponse {
|
||||
lat: number;
|
||||
lon: number;
|
||||
s: number;
|
||||
@@ -174,4 +174,16 @@ declare namespace Model {
|
||||
fish_condition?: string;
|
||||
gear_usage?: string;
|
||||
}
|
||||
interface NewFishingLogRequest {
|
||||
trip_id: string;
|
||||
start_at: Date; // ISO datetime
|
||||
start_lat: number;
|
||||
start_lon: number;
|
||||
weather_description: string;
|
||||
}
|
||||
|
||||
interface TripUpdateStateRequest {
|
||||
status: number;
|
||||
note?: string;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user