Created
January 10, 2017 12:02
-
-
Save Pradnya-Paranjape/866240c47909f2c582ff73777dd01b84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if(data.file_id) { | |
| self.postProcessFile(data.file_id, candidateRec.id) | |
| .then(function() { | |
| fulfill(true); | |
| }) | |
| .catch(function(e) { | |
| reject(e); | |
| }); | |
| } else { | |
| fulfill(true); | |
| } | |
| candidateModel.prototype.postProcessFile = function(fileId, entityId) { | |
| var self = this; | |
| var log = self.log; | |
| return new Promise(function(fulfill, reject) { | |
| //Process file for preview generation and text extraction | |
| var dataToPost = { | |
| metadata: { | |
| "x-plugin-task-preview": "{\"doc_preview\":true,\"text_extract\":true}" | |
| }, | |
| entity_id: entityId | |
| }; | |
| self.storageSdk.postProcessFile(fileId, dataToPost) | |
| .then(function(record) { | |
| var recObject = JSON.parse(record); | |
| fulfill(recObject); | |
| }) | |
| .catch(function(e) { | |
| return reject(e); | |
| }); | |
| }); | |
| }; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment