diff --git a/src/api/spots.ts b/src/api/spots.ts index 0a37476..0892905 100644 --- a/src/api/spots.ts +++ b/src/api/spots.ts @@ -42,6 +42,8 @@ export const spotsApi = { http.get(`/api/spots/${spotId}/mates${userId ? `?userId=${userId}` : ''}`), aiMates: (spotId: number, dogId: number) => http.get(`/api/spots/${spotId}/ai-mates?dogId=${dogId}`), + frequentBreeds: (spotId: number) => + http.get<{ breeds: string[] }>(`/api/spots/${spotId}/frequent-breeds`), reviews: (spotId: number) => http.get(`/api/spots/${spotId}/reviews`), checkIn: (spotId: number, userId: number, dogId: number) => http.post(`/api/spots/${spotId}/checkins`, { userId, dogId }), diff --git a/src/pages/HomePage.vue b/src/pages/HomePage.vue index 9c30e89..89b24ca 100644 --- a/src/pages/HomePage.vue +++ b/src/pages/HomePage.vue @@ -23,6 +23,15 @@ @click="onCheckIn" /> + +
+ + 이 시간대 자주 보이는 견종 · {{ frequentBreeds.join(', ') }} +
+
@@ -131,6 +140,7 @@ const spots = ref([]) const currentSpot = ref(null) const reviews = ref([]) const mates = ref([]) +const frequentBreeds = ref([]) const checkedIn = ref(false) const checkingIn = ref(false) const matchingDogId = ref(null) @@ -169,12 +179,14 @@ async function onSelectSpot(spotId: number) { } async function refreshSpot(spotId: number) { - const [r, m] = await Promise.all([ + const [r, m, fb] = await Promise.all([ spotsApi.reviews(spotId), spotsApi.mates(spotId, currentUserId()), + spotsApi.frequentBreeds(spotId), ]) reviews.value = r mates.value = m + frequentBreeds.value = fb.breeds } async function onCheckIn() {