Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -38,7 +38,8 @@ export interface CheckInResult {
|
|||||||
|
|
||||||
export const spotsApi = {
|
export const spotsApi = {
|
||||||
list: () => http.get<Spot[]>('/api/spots'),
|
list: () => http.get<Spot[]>('/api/spots'),
|
||||||
mates: (spotId: number) => http.get<Mate[]>(`/api/spots/${spotId}/mates`),
|
mates: (spotId: number, userId?: number) =>
|
||||||
|
http.get<Mate[]>(`/api/spots/${spotId}/mates${userId ? `?userId=${userId}` : ''}`),
|
||||||
aiMates: (spotId: number, dogId: number) =>
|
aiMates: (spotId: number, dogId: number) =>
|
||||||
http.get<AiMate[]>(`/api/spots/${spotId}/ai-mates?dogId=${dogId}`),
|
http.get<AiMate[]>(`/api/spots/${spotId}/ai-mates?dogId=${dogId}`),
|
||||||
reviews: (spotId: number) => http.get<Review[]>(`/api/spots/${spotId}/reviews`),
|
reviews: (spotId: number) => http.get<Review[]>(`/api/spots/${spotId}/reviews`),
|
||||||
|
|||||||
@@ -183,7 +183,10 @@ async function onSelectSpot(spotId: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function refreshSpot(spotId: number) {
|
async function refreshSpot(spotId: number) {
|
||||||
const [r, m] = await Promise.all([spotsApi.reviews(spotId), spotsApi.mates(spotId)])
|
const [r, m] = await Promise.all([
|
||||||
|
spotsApi.reviews(spotId),
|
||||||
|
spotsApi.mates(spotId, currentUserId()),
|
||||||
|
])
|
||||||
reviews.value = r
|
reviews.value = r
|
||||||
mates.value = m
|
mates.value = m
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user