2026-07-11 09:18:23 +09:00
|
|
|
import { http } from './http'
|
|
|
|
|
|
|
|
|
|
export interface ChatMessage {
|
|
|
|
|
id: number
|
2026-07-11 15:04:21 +09:00
|
|
|
spotId: number | null
|
|
|
|
|
matchId: number | null
|
2026-07-11 09:18:23 +09:00
|
|
|
senderId: number
|
|
|
|
|
senderNickname: string
|
|
|
|
|
content: string
|
|
|
|
|
createdAt: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const chatApi = {
|
|
|
|
|
history: (spotId: number) => http.get<ChatMessage[]>(`/api/chat/spots/${spotId}/messages`),
|
2026-07-11 15:04:21 +09:00
|
|
|
matchHistory: (matchId: number) =>
|
|
|
|
|
http.get<ChatMessage[]>(`/api/chat/matches/${matchId}/messages`),
|
2026-07-11 09:18:23 +09:00
|
|
|
}
|