From 2497c29ef0d1e178c8b3aa96e8304ee6765bae4e Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Fri, 14 Sep 2018 16:51:25 +0100 Subject: [PATCH] Use returned discussion from API We now use the returned discussion instead of re-fetching all of the discussions and filtering out the ones we don't need. This speeds up the process of creating a diff discussions by saving us another API request before we can render the discussion --- .../diffs/components/diff_line_note_form.vue | 48 ++++++------------- app/assets/javascripts/diffs/store/actions.js | 19 +++++++- .../javascripts/notes/stores/actions.js | 20 ++------ .../javascripts/notes/stores/mutations.js | 3 +- .../components/diff_line_note_form_spec.js | 27 +++++------ spec/javascripts/diffs/store/actions_spec.js | 46 ++++++++++++++---- 6 files changed, 87 insertions(+), 76 deletions(-) diff --git a/app/assets/javascripts/diffs/components/diff_line_note_form.vue b/app/assets/javascripts/diffs/components/diff_line_note_form.vue index 0fa14615532..bb9bb821de3 100644 --- a/app/assets/javascripts/diffs/components/diff_line_note_form.vue +++ b/app/assets/javascripts/diffs/components/diff_line_note_form.vue @@ -1,12 +1,9 @@