Added suggestions page Updated SuggestionsController with unlimited param

• Added:
- suggestions page in app

• Updated:
- SuggestionsController with unlimited param to show max 80 items
This commit is contained in:
mgabdev
2020-09-10 16:21:20 -05:00
parent d1d6124ffc
commit d3355f8bd5
5 changed files with 78 additions and 4 deletions

View File

@@ -27,13 +27,13 @@ export function fetchPopularSuggestions() {
}
}
export function fetchRelatedSuggestions() {
export function fetchRelatedSuggestions(unlimited = false) {
return (dispatch, getState) => {
if (!me) return false
dispatch(fetchSuggestionsRequest(SUGGESTION_TYPE_RELATED))
api(getState).get(`/api/v1/suggestions?type=${SUGGESTION_TYPE_RELATED}`).then(response => {
api(getState).get(`/api/v1/suggestions?type=${SUGGESTION_TYPE_RELATED}&unlimited=${!!unlimited}`).then(response => {
dispatch(importFetchedAccounts(response.data))
dispatch(fetchSuggestionsSuccess(response.data, SUGGESTION_TYPE_RELATED))
dispatch(fetchRelationships(response.data.map(item => item.id)))