Skip to content

Commit

Permalink
return filler data
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinBeczak committed Jan 7, 2024
1 parent 7fbb220 commit 4aab3fa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/services/Leaderboard/Leaderboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export const fetchLeaderboardForUser = async (userId, bracket=0, numberMonths=1,
return results;
} catch (error) {
console.error('Error fetching user leaderboard:', error)
return []
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/services/Place/Place.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const fetchPlace = function(lat, lng) {
`https://nominatim.openstreetmap.org/reverse?format=json&lat=${lat}&lon=${lng}`

return async function(dispatch) {
return fetchContent(placeURI, placeSchema(), {omitCredentials: true}).then(normalizedResults => {
return await fetchContent(placeURI, placeSchema(), {omitCredentials: true}).then(normalizedResults => {
dispatch(receivePlace(normalizedResults.entities))
return normalizedResults
})
Expand Down
14 changes: 7 additions & 7 deletions src/services/SuperAdmin/SuperAdminChallenges.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ export const receiveAdminChallenges = function (normalizedEntities, dispatch) {
}

export const fetchAdminChallenges = function (query) {
return async function (dispatch) {
try {
const normalizedResults = await dispatch(performChallengeSearch(query, 50000, true))
return dispatch(receiveAdminChallenges(normalizedResults.entities, dispatch))
} catch (error) {
console.error('Error searching admin challenges:', error)
}
return async function (dispatch) {
try {
const normalizedResults = await dispatch(performChallengeSearch(query, 50000, true))
return dispatch(receiveAdminChallenges(normalizedResults.entities, dispatch))
} catch (error) {
console.error('Error searching admin challenges:', error)
}
}
}
8 changes: 5 additions & 3 deletions src/services/Task/TaskReview/TaskReview.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export const fetchNearbyReviewTasks = function(taskId, criteria={}, limit=5, asM
_get(criteria, 'excludeOtherReviewers'),
null,
_get(criteria, 'invertFields', {}))
const params = { limit, ...searchParameters, asMetaReview }
const params = {limit, ...searchParameters, asMetaReview}

return await new Endpoint(
api.tasks.nearbyReviewTasks,
Expand Down Expand Up @@ -437,7 +437,7 @@ export const loadNextReviewTask = function(criteria={}, lastTaskId, asMetaReview
_get(criteria, 'invertFields', {}))

return async function(dispatch) {
const params = { sort, order, ...searchParameters, asMetaReview }
const params = {sort, order, ...searchParameters, asMetaReview}

if (_isFinite(lastTaskId)) {
params.lastTaskId = lastTaskId
Expand All @@ -454,6 +454,7 @@ export const loadNextReviewTask = function(criteria={}, lastTaskId, asMetaReview
))
} catch (error) {
console.error('Error fetching review next task:', error)
dispatch(addError(AppErrors.challenge.fetchFailure))
}
}
}
Expand All @@ -465,7 +466,7 @@ export const loadNextReviewTask = function(criteria={}, lastTaskId, asMetaReview
* includeMapillary to true
*/
export const fetchTaskForReview = function(taskId, includeMapillary=false) {
return async function (dispatch) {
return async function(dispatch) {
return await new Endpoint(api.task.startReview, {
schema: taskSchema(),
variables: {id: taskId},
Expand All @@ -475,6 +476,7 @@ export const fetchTaskForReview = function(taskId, includeMapillary=false) {
return normalizedResults
}).catch(error => {
console.error('Error fetching task for review:', error)
dispatch(addError(AppErrors.challenge.fetchFailure))
})
}
}
Expand Down

0 comments on commit 4aab3fa

Please sign in to comment.