- D04 업체 추가 · 저장에 조각 id · 옛 연도 지정 업체 = 그 연도 첫 줄 - B03 [예정노선에서 가져오기] 줄 · B01 받은 예정노선 연도 칸 · [연결] 제목에 「본선 0+0~12+10」 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
30 lines
1.2 KiB
TypeScript
30 lines
1.2 KiB
TypeScript
/* =============================================================================
|
|
* B01_Dashboard_UI_AssignedPlans.ts
|
|
* 「받은 예정노선」 자료 읽기(요구서 345 2-2 · PLAN 528-2 · 563-2) — 우리 회사에 지정된 예정노선 조각(옛 = 연도).
|
|
* 화면 = `B01_Dashboard_UI_View_Assigned.ts` · [연결] 모달 = `B01_Dashboard_UI_PlanLink`
|
|
* ========================================================================== */
|
|
|
|
import { API_BASE_URL } from "@config/config_frontend";
|
|
|
|
export interface AssignedPlan {
|
|
assignee_id: number;
|
|
project_id: string;
|
|
project_name: string;
|
|
year: number;
|
|
/** 조각 이름 「본선 0+0~12+10」 — 옛 연도 지정 = null */
|
|
piece_label: string | null;
|
|
linked_project_id: string | null;
|
|
/** 연도 확정 시각 — 서버 UTC */
|
|
confirmed_at: string | null;
|
|
update_available: boolean;
|
|
}
|
|
|
|
/** 받은 예정노선 — 실패 · 없음 = 빈 목록(구역을 안 그림) */
|
|
export async function fetchAssignedPlans(): Promise<AssignedPlan[]> {
|
|
const response = await fetch(`${API_BASE_URL}/dashboard/plan-routes/assigned`, {
|
|
credentials: "include",
|
|
});
|
|
if (!response.ok) return [];
|
|
return ((await response.json()) as { routes?: AssignedPlan[] }).routes ?? [];
|
|
}
|