Created
June 29, 2018 09:00
-
-
Save turingmachine/2c53100d9dbe79ffb0ae95f260fc6f80 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
result = HTTP.call('PUT', `${apiEndpoint}/${result.data.orderKey}/parcels/${result.data.relations[0]['parcelKey']}/label`, { | |
auth: apiAuth, | |
headers: { | |
'Content-Type': 'multipart/form-data; boundary=3cc6d52cb19500f900214f6a778c15ef', | |
}, | |
content: [ | |
'--3cc6d52cb19500f900214f6a778c15ef', | |
'Content-Disposition: form-data; name="label"; filename="label.png"', | |
'Content-Type: application/octet-stream', | |
'Content-Transfer-Encoding: base64', | |
'', | |
label.image, | |
'--3cc6d52cb19500f900214f6a778c15ef--', | |
'', | |
].join('\r\n'), | |
}); | |
if (result.statusCode !== 200 || !_.isEmpty(result.data.errors)) { | |
const errors = { | |
statusCode: result.statusCode, | |
errors: result.data.errors, | |
}; | |
Requests.update(inquiry._id, { | |
$push: { pickAtHomeErrors: errors }, | |
}); | |
throw errors; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment