o2o-negosium-original/frontend/src/apis/chat/chat.mutations.ts
민헌 ce536b43d6 feat(frontend): 채팅 페이지 API 연동 + KST 시각 표시
- apis/chat 모듈(api/queries/mutations/keys/type) + useChatController(append-only send 주입)
- useChatStore 재배선, list→chat session_id 라우팅 연결, mock 제거
- 마감/종료/권한 시 입력 잠금·목록 복귀, 가격범위 인라인 에러, CHAT_IN_PROGRESS 처리
- list 마감일 KST(Asia/Seoul) 고정 표시(lib/datetime formatKstDateTime)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 14:25:07 +09:00

15 lines
543 B
TypeScript

// 채팅 도메인의 변경(useMutation) 훅.
import { useMutation } from '@tanstack/react-query'
import { chatApi } from './chat.api'
import type { ChatSendRequest } from './chat.type'
/**
* 협상 한 턴 전송. append-only 라 캐시 무효화/refetch 를 하지 않는다.
* 응답의 새 봇 메시지는 호출부(컨트롤러)가 스토어에 직접 append 한다.
*/
export function useChatSendMutation(sessionId: string) {
return useMutation({
mutationFn: (body: ChatSendRequest) => chatApi.send(sessionId, body),
})
}