Skip to content

Commit

Permalink
feat(space_memberships): Add query param (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
msalpietro authored and axe312ger committed Feb 7, 2018
1 parent a3d7e5e commit 0c36d6f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/create-space-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -828,17 +828,18 @@ export default function createSpaceApi ({
/**
* Gets a collection of Space Memberships
* @memberof ContentfulSpaceAPI
* @param {Object=} query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
* @return {Promise<SpaceMembership.SpaceMembershipCollection>} Promise for a collection of Space Memberships
* @example
* const contentful = require('contentful-management')
*
* client.getSpace('<space_id>')
* .then((space) => space.getSpaceMemberships())
* .then((space) => space.getSpaceMemberships({'limit': 100})) // you can add more queries as 'key': 'value'
* .then((response) => console.log(response.items))
* .catch(console.error)
*/
function getSpaceMemberships () {
return http.get('space_memberships')
function getSpaceMemberships (query = {}) {
return http.get('space_memberships', createRequestConfig({query: query}))
.then((response) => wrapSpaceMembershipCollection(http, response.data), errorHandler)
}

Expand Down

0 comments on commit 0c36d6f

Please sign in to comment.