import { ndmClient, userClient, type Station } from '@/apis';
import { unwrapVoidResponse } from '@/utils';

export const verifyApi = async (options?: { stationCode?: Station['code']; signal?: AbortSignal }) => {
  const { stationCode, signal } = options ?? {};
  const client = stationCode ? ndmClient : userClient;
  const prefix = stationCode ? `/${stationCode}` : '';
  const endpoint = `${prefix}/api/ndm/ndmKeepAlive/verify`;
  const resp = await client.post<void>(endpoint, {}, { retRaw: true, timeout: 5000, signal });
  unwrapVoidResponse(resp);
};
