Skip to content

fix: Refresh model after speaker deletion #5486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 7, 2020

Conversation

akash2408
Copy link
Contributor

@akash2408 akash2408 commented Nov 4, 2020

Fixes #5435

Short description of what this resolves:

ezgif com-gif-maker

Changes proposed in this pull request:

Checklist

  • I have read the Contribution & Best practices Guide.
  • My branch is up-to-date with the Upstream development branch.
  • The acceptance, integration, unit tests and linter pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@vercel
Copy link

vercel bot commented Nov 4, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/nnui7esny
✅ Preview: https://open-event-frontend-git-speaker.eventyay.vercel.app

@codecov
Copy link

codecov bot commented Nov 4, 2020

Codecov Report

Merging #5486 into development will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #5486      +/-   ##
===============================================
- Coverage        23.25%   23.24%   -0.01%     
===============================================
  Files              493      493              
  Lines             5182     5183       +1     
  Branches            38       38              
===============================================
  Hits              1205     1205              
- Misses            3972     3973       +1     
  Partials             5        5              
Impacted Files Coverage Δ
app/controllers/events/view/speakers/list.js 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2808523...9b68cd9. Read the comment docs.

this.notify.error(this.l10n.t('An unexpected error has occurred.'));
}
this.set('isLoading', false);
speaker.destroyRecord()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use async await

try {
await speaker.destroyRecord();
this.notify.success(this.l10n.t('Speaker has been deleted successfully.'));
this.refreshModel.bind(this)();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for bind call. this is literally this already

Co-authored-by: Areeb Jamal <jamal.areeb@gmail.com>
@iamareebjamal
Copy link
Member

Great. See how simple the PR became. Please add a GIF to show the change

@akash2408
Copy link
Contributor Author

akash2408 commented Nov 5, 2020 via email

@iamareebjamal iamareebjamal changed the title Speaker: Deleting Speaker from Dashboard does not remove the deleted speaker from the page #5435 fix: Refresh model after speaker deletion Nov 7, 2020
@auto-label auto-label bot added the fix label Nov 7, 2020
@iamareebjamal iamareebjamal merged commit dc20caa into fossasia:development Nov 7, 2020
@akash2408 akash2408 deleted the speaker branch November 7, 2020 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Speaker: Deleting Speaker from Dashboard does not remove the deleted speaker from the page
2 participants