From 684e5e5ddcb69cb80742dc6b43e5d6ea092d89d0 Mon Sep 17 00:00:00 2001 From: Hunternif Date: Tue, 7 May 2019 21:47:08 +0700 Subject: client: tags with categories are saved immediately after input, in all places: upload page, post editor, bulk tag editor --- client/js/controllers/post_upload_controller.js | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'client/js/controllers/post_upload_controller.js') diff --git a/client/js/controllers/post_upload_controller.js b/client/js/controllers/post_upload_controller.js index 4982530..f176803 100644 --- a/client/js/controllers/post_upload_controller.js +++ b/client/js/controllers/post_upload_controller.js @@ -64,29 +64,6 @@ class PostUploadController { promise.then(() => this._uploadSinglePost( uploadable, e.detail.skipDuplicates, e.detail.copyTagsToOriginals)), Promise.resolve()) - .then(() => { - // now save the new tags with categories - //TODO: re-use this code in post_main_controller.js - if (!e.detail.newTags) { - return Promise.resolve(); - } - let tagPromises = []; - for (let newTag of e.detail.newTags) { - // load the tag that was created during updating the post - tagPromises.push( - Tag.get(newTag.names[0]).then(tag => { - tag.category = newTag.category; - return tag.save(); - } - ).then(() => { - e.detail.newTags.removeByName(newTag.names[0]); - }, error => { - tagErrors.push(error.message); - }) - ); - } - return Promise.all(tagPromises); - }) .then(() => { this._view.clearMessages(); misc.disableExitConfirmation(); -- cgit v1.3