| | |
| | | else { |
| | | uploadIds = operation.data['upload_ids'] || []; |
| | | } |
| | | |
| | | if (operation.data['field_name'] !== '' && operation.data['item_id']) { |
| | | this.notify('upload_complete', { |
| | | field: operation.data['field_name'], |
| | | item_id: operation['item_id'] |
| | | }); |
| | | } |
| | | } |
| | | |
| | | // If not in data, check result (for completed operations from backend) |
| | |
| | | } |
| | | } |
| | | |
| | | async queueUploads(endpoint, fieldId) { |
| | | async queueUploads(endpoint, fieldId, dependsOn = null) { |
| | | let data = new FormData(); |
| | | const field = this.fields.get(fieldId); |
| | | if (!field) return; |
| | |
| | | data.append('subtype', field.config.subtype); |
| | | data.append('item_id', field.config.itemID); |
| | | data.append('destination', field.config.destination); |
| | | if (dependsOn) { |
| | | data.append('depends_on', dependsOn); |
| | | } |
| | | } |
| | | |
| | | let posts, uploadMap, files; |