parent
cc938d76a7
commit
99511ee1b5
3 changed files with 69 additions and 1 deletions
|
@ -49,6 +49,11 @@ class Api::V1::StatusesController < Api::BaseController
|
|||
loaded_descendants = cache_collection(descendants_results, Status)
|
||||
loaded_references = cache_collection(references_results, Status)
|
||||
|
||||
unless params[:with_reference]
|
||||
loaded_ancestors = (loaded_ancestors + loaded_references).uniq(&:id)
|
||||
loaded_references = []
|
||||
end
|
||||
|
||||
@context = Context.new(ancestors: loaded_ancestors, descendants: loaded_descendants, references: loaded_references)
|
||||
statuses = [@status] + @context.ancestors + @context.descendants + @context.references
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@ export function fetchContext(id) {
|
|||
return (dispatch, getState) => {
|
||||
dispatch(fetchContextRequest(id));
|
||||
|
||||
api(getState).get(`/api/v1/statuses/${id}/context`).then(response => {
|
||||
api(getState).get(`/api/v1/statuses/${id}/context?with_reference=1`).then(response => {
|
||||
dispatch(importFetchedStatuses(response.data.ancestors.concat(response.data.descendants).concat(response.data.references)));
|
||||
dispatch(fetchContextSuccess(id, response.data.ancestors, response.data.descendants, response.data.references));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue