체크인 성공 시 /api/spots/{id}/ai-mates 를 호출해 사이좋게 지낼 만한
강아지를 궁합점수·이유와 함께 표시. 로딩 스피너·빈 상태 처리 포함.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,14 @@ export interface Mate {
|
||||
breed: string | null
|
||||
}
|
||||
|
||||
export interface AiMate {
|
||||
dogId: number
|
||||
name: string
|
||||
breed: string | null
|
||||
score: number
|
||||
reason: string
|
||||
}
|
||||
|
||||
export interface Review {
|
||||
id: number
|
||||
tag: string | null
|
||||
@@ -31,6 +39,8 @@ export interface CheckInResult {
|
||||
export const spotsApi = {
|
||||
list: () => http.get<Spot[]>('/api/spots'),
|
||||
mates: (spotId: number) => http.get<Mate[]>(`/api/spots/${spotId}/mates`),
|
||||
aiMates: (spotId: number, dogId: number) =>
|
||||
http.get<AiMate[]>(`/api/spots/${spotId}/ai-mates?dogId=${dogId}`),
|
||||
reviews: (spotId: number) => http.get<Review[]>(`/api/spots/${spotId}/reviews`),
|
||||
checkIn: (spotId: number, userId: number, dogId: number) =>
|
||||
http.post<CheckInResult>(`/api/spots/${spotId}/checkins`, { userId, dogId }),
|
||||
|
||||
Reference in New Issue
Block a user