feat(sgw): Implement Create or Update Banzone functionality with map integration

This commit is contained in:
Lê Tuấn Anh
2026-01-27 12:17:11 +07:00
parent c9aeca0ed9
commit a11e2c2991
46 changed files with 4660 additions and 39 deletions

View File

@@ -0,0 +1,36 @@
import {
SGW_ROUTE_CREATE_OR_UPDATE_FISH,
SGW_ROUTE_GET_FISH,
} from '@/constants/slave/sgw/routes';
import { request } from '@umijs/max';
export async function apiGetFishSpecies(
body?: SgwModel.SearchFishPaginationBody,
): Promise<SgwModel.FishSpeciesResponse> {
return request<SgwModel.FishSpeciesResponse>(SGW_ROUTE_GET_FISH, {
method: 'POST',
data: body,
});
}
export async function apiCreateFishSpecies(body?: SgwModel.Fish) {
return request<SgwModel.CreateFishResponse>(SGW_ROUTE_CREATE_OR_UPDATE_FISH, {
method: 'POST',
data: [body],
getResponse: true,
});
}
export async function apiUpdateFishSpecies(body?: SgwModel.Fish) {
return request(SGW_ROUTE_CREATE_OR_UPDATE_FISH, {
method: 'PUT',
data: body,
getResponse: true,
});
}
export async function apiDeleteFishSpecies(id?: string) {
return request(`${SGW_ROUTE_CREATE_OR_UPDATE_FISH}/${id}`, {
method: 'DELETE',
getResponse: true,
});
}