Skip to content

Commit

Permalink
[client] Allow specifying a request body for dataset creation requests
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars authored and bjoerge committed Mar 15, 2018
1 parent d002b59 commit 75e60db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/@sanity/client/src/datasets/datasetsClient.js
Expand Up @@ -6,8 +6,8 @@ function DatasetsClient(client) {
}

assign(DatasetsClient.prototype, {
create(name) {
return this._modify('PUT', name)
create(name, options) {
return this._modify('PUT', name, options)
},

delete(name) {
Expand All @@ -18,9 +18,9 @@ assign(DatasetsClient.prototype, {
return this.request({uri: '/datasets'})
},

_modify(method, name) {
_modify(method, name, body) {
validate.dataset(name)
return this.request({method, uri: `/datasets/${name}`})
return this.request({method, uri: `/datasets/${name}`, body})
}
})

Expand Down

0 comments on commit 75e60db

Please sign in to comment.