- if (attributes.name) req.field('name', attributes.name)
- if (attributes.category) req.field('category', attributes.category)
- if (attributes.licence) req.field('licence', attributes.licence)
- if (attributes.language) req.field('language', attributes.language)
- if (attributes.nsfw) req.field('nsfw', attributes.nsfw)
- if (attributes.description) req.field('description', attributes.description)
-
- if (attributes.tags) {
- for (let i = 0; i < attributes.tags.length; i++) {
- req.field('tags[' + i + ']', attributes.tags[i])
- }
- }
-
- req.expect(specialStatus).end(end)
+ request(url)
+ .put(path)
+ .send(body)
+ .set('Accept', 'application/json')
+ .set('Authorization', 'Bearer ' + accessToken)
+ .expect(specialStatus)
+ .end(end)