diff --git a/README.md b/README.md index 219b3a9..f47e3e2 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,7 @@ Check out [the rokka documentation](https://rokka.io/documentation/references/se Sorting works with user metadata as well and can be passed as either an array or as a comma separated string. -#### rokka.sourceimages.get(organization, hash) → Promise +#### rokka.sourceimages.get(organization, hash, queryParams) → Promise Get information of a source image by hash. diff --git a/src/apis/sourceimages.js b/src/apis/sourceimages.js index 40a3e03..6dd0c63 100644 --- a/src/apis/sourceimages.js +++ b/src/apis/sourceimages.js @@ -56,7 +56,8 @@ export default state => { offset = null, sort = null, search = null, - facets = null + facets = null, + deleted = null } = {} ) => { let queryParams = {} @@ -70,6 +71,10 @@ export default state => { if (facets !== null) { queryParams.facets = facets } + if (deleted !== null) { + queryParams.deleted = deleted + } + if (sort !== null) { if (Array.isArray(sort)) { sort = sort.join(',') @@ -100,10 +105,16 @@ export default state => { * @authenticated * @param {string} organization name * @param {string} hash image hash + * @param {Object} queryParams like {deleted: true} * @return {Promise} */ - sourceimages.get = (organization, hash) => { - return state.request('GET', `sourceimages/${organization}/${hash}`) + sourceimages.get = (organization, hash, queryParams = {}) => { + return state.request( + 'GET', + `sourceimages/${organization}/${hash}`, + null, + queryParams + ) } /**