Skip to content

Commit

Permalink
remove type restriction for job attach method
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashanth Sadasivan authored and dboskovic committed Sep 19, 2018
1 parent aeef68b commit 1259d4f
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,10 @@ Response = (function () {
}
Response.prototype.job_attach = function (...attachments) {
const requiredLabels = [ 'type', 'label', 'value' ]
const allowedTypes = [ 'link', 'password' ]
for (const attachment of attachments) {
if (!~requiredLabels.every(l => ~Object.keys(attachment).indexOf(l))) {
throw new Error(`Attachment requires mandatory properties ${requiredLabels.join(', ')}`)
}
if (!~allowedTypes.indexOf(attachment.type)) {
throw new Error(`Attachment must be of one of the following types ${allowedTypes.join(', ')}`)
}
}
this._attachments.push(...attachments)
this.meta('set_job_attachments', JSON.stringify(this._attachments))
Expand Down

0 comments on commit 1259d4f

Please sign in to comment.