return Api.documentsApi
.getFileContent(context.state.document.versions[0].file,
{ ...store.getters['headerToken'], responseType: 'blob' })
.then(blob => {
// read file content
return new Promise((resolve, reject) => {
const fr = new FileReader()
fr.onload = function (e) {
fileContent = e.target.result
console.log(fileContent)
resolve(fileContent)
}
fr.readAsArrayBuffer(blob)
})
})
...
Groups.findOne({ groupInvite: req.body.groupInvite })
.then(findedGroup => {
findedGroup.find({ $and: [{"users.login": req.body.userLogin}, {"users.token": req.body.userInvite }] },{ users: 1 })
.then(findedUser => {
console.log(findedUser);
...