app/javascript/vue/tasks/images/new_image/store/actions/applyTags.js
import { Tag } from '@/routes/endpoints'
export default ({ state }, payload) => {
const { objectType, objectIds } = payload
const requests = state.tagsForImage.map((tag) =>
Tag.createBatch({
keyword_id: tag.id,
object_id: objectIds,
object_type: objectType
})
)
Promise.all(requests).then((_) => {
state.settings.applied.tags = true
TW.workbench.alert.create('All tag(s) was successfully created.', 'notice')
})
}