Skip to content
Snippets Groups Projects
Commit b04fd88c authored by Eugen Ciur's avatar Eugen Ciur
Browse files

fix tag refresh issue

parent 99066a5f
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@ export default class TableRowComponent extends Component {
// being edited i.e. in edit mode
@tracked edit_mode_id = 0;
@service store;
@service router;
@action
async onRemove(tag) {
......@@ -40,7 +41,10 @@ export default class TableRowComponent extends Component {
this.store.findRecord('tag', tag.id).then((found_tag) => {
found_tag.name = tag.name;
found_tag.description = tag.description;
found_tag.save();
found_tag.save().then(() => {
// refresh pinned tags on the sidebar
that.router.refresh();
});
});
} else {
console.warn(`onSaveChanges received tag=${tag} object without tag ID`);
......
......@@ -3,9 +3,4 @@ import BaseRoute from 'papermerge/routes/base';
export default class ApplicationRoute extends BaseRoute {
async model() {
return this.store.findAll('tag').then((tags) => {
return tags.filter(tag => tag.pinned);
});
}
}
import BaseRoute from 'papermerge/routes/base';
export default class AuthenticatedRoute extends BaseRoute {
async model() {
return this.store.findAll('tag').then((tags) => {
return tags.filter(tag => tag.pinned);
});
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment