ship-gis/src/api/favoriteApi.js

28 lines
875 B
JavaScript
Raw Normal View 히스토리

import { fetchWithAuth } from './fetchWithAuth';
/**
* 관심선박 목록 조회
* @returns {Promise<Array>} 관심선박 목록
*/
export async function fetchFavoriteShips() {
const response = await fetchWithAuth('/api/gis/my/dashboard/ship/attention/static/search');
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const result = await response.json();
return result?.data || [];
}
/**
* 관심구역 목록 조회
* @returns {Promise<Array>} 관심구역 목록
*/
export async function fetchRealms() {
const response = await fetchWithAuth('/api/gis/sea-relm/manage/show', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const result = await response.json();
return result?.seaRelmManageShowDtoList || [];
}