adjust location state with new response

This commit is contained in:
nochill 2024-08-19 07:41:35 +07:00
parent 5183a90b59
commit f1fd9bcbb9
3 changed files with 1598 additions and 1297 deletions

File diff suppressed because it is too large Load Diff

View File

@ -147,8 +147,8 @@ function Discovery() {
async function getRecentLocations() {
try {
const locations = await getListRecentLocationsRatingsService(20)
setData((prevState) => ({ ...prevState, locations: locations.data }))
const locations = await getListRecentLocationsRatingsService(15)
setData((prevState) => ({ ...prevState, locations: locations.data.locations }))
} catch (error) {
console.log(error)
}

View File

@ -28,7 +28,7 @@ function Home() {
async function getRecentLocations() {
try {
const locations = await getListRecentLocationsRatingsService(12)
setRecentLocations(locations.data)
setRecentLocations(locations.data.locations)
// setIsLoading(false)
} catch (error) {
console.log(error)