8457f83f17
- 등록 폼: 크기 셀렉트→토글, 성별(남아/여아)·연령(출생 연·월) 추가 - 프로필/등록에 'AI 추천 조건'(선호 성별/연령/중성화) 섹션 - HomePage AI 섹션의 중성화 토글 제거 → 저장된 조건을 백엔드가 사용 - 체크인 완료 알림 문구에서 스팟 채팅 문구 제거 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
53 lines
1.3 KiB
TypeScript
53 lines
1.3 KiB
TypeScript
import { http } from './http'
|
|
|
|
export interface Spot {
|
|
id: number
|
|
name: string
|
|
type: string
|
|
latitude: number | null
|
|
longitude: number | null
|
|
}
|
|
|
|
export interface Mate {
|
|
dogId: number
|
|
name: string
|
|
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
|
|
content: string | null
|
|
createdAt: string
|
|
}
|
|
|
|
export interface CheckInResult {
|
|
id: number
|
|
spotId: number
|
|
dogId: number
|
|
expiresAt: string
|
|
}
|
|
|
|
export const spotsApi = {
|
|
list: () => http.get<Spot[]>('/api/spots'),
|
|
mates: (spotId: number, userId?: number) =>
|
|
http.get<Mate[]>(`/api/spots/${spotId}/mates${userId ? `?userId=${userId}` : ''}`),
|
|
aiMates: (spotId: number, dogId: number) =>
|
|
http.get<AiMate[]>(`/api/spots/${spotId}/ai-mates?dogId=${dogId}`),
|
|
frequentBreeds: (spotId: number) =>
|
|
http.get<{ breeds: string[] }>(`/api/spots/${spotId}/frequent-breeds`),
|
|
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 }),
|
|
addReview: (spotId: number, userId: number, tag: string) =>
|
|
http.post<Review>(`/api/spots/${spotId}/reviews`, { userId, tag }),
|
|
}
|