/* ============================================================================= * B05_Profile_UI_RouteReset.ts * 노선 초기화 = 추천 [적용](요구 289 · 493-2) — 확인 창 글 몫. * * 지워질 수 = 서버 저장분(구조물 · 관 · 추가 측점) — 서버가 [적용]에서 지우는 것과 같음(응답 * `route_reset.dropped`) · 세션 초안은 안 셈 · 관 = 저장 파일이 없으면 0(응답 관은 자동 제안). * 구조물 · 관 = 페이지 자료 줄(저장 · 적용 뒤 다시 받음) · 추가 측점 = 지금 받음. * 손 고침 [저장]은 묻지 않음(보이는 화면 그대로 저장). * 글 = `logic/B05_Profile_Route_Reset`. * ========================================================================== */ import { pagePipes, pageStructures } from "../A00_Common/design/design_page_data"; import { fetchSavedPlusStations } from "./B05_Profile_Api_PlusStations"; import { routeResetConfirmText } from "./logic/B05_Profile_Route_Reset"; /** 추천 [적용] 확인 창 글 — 서버 저장분에서 지워질 수(못 받은 칸 = 0). */ export async function applyResetText(projectId: string): Promise { const [structures, pipes, plusStations] = await Promise.all([ pageStructures(projectId).then( (list) => list.structures?.length ?? 0, () => 0, ), pagePipes(projectId).then( (list) => (list.saved ? (list.pipe_points?.length ?? 0) : 0), () => 0, ), fetchSavedPlusStations(projectId).then( (list) => list.length, () => 0, ), ]); return routeResetConfirmText({ structures, pipes, plusStations }); }