File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
packages/cozy-stack-client/src Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -1895,6 +1895,7 @@ Implements the `DocumentCollection` API along with specific methods for
18951895** Kind** : global class
18961896
18971897* [ SharingCollection] ( #SharingCollection )
1898+ * [ .findByDoctype(doctype, [ options] )] ( #SharingCollection+findByDoctype ) ⇒ <code >object</code >
18981899 * [ .get(id)] ( #SharingCollection+get ) ⇒ [ <code >Sharing</code >] ( #Sharing )
18991900 * [ .fetchSharedDrives()] ( #SharingCollection+fetchSharedDrives ) ⇒ <code >Promise.< ; {data: Array.< ; Sharing> ; }> ; </code >
19001901 * [ .create(params)] ( #SharingCollection+create )
@@ -1905,6 +1906,20 @@ Implements the `DocumentCollection` API along with specific methods for
19051906 * [ .revokeSelf(sharing)] ( #SharingCollection+revokeSelf )
19061907 * [ .revokeAllRecipients(sharing)] ( #SharingCollection+revokeAllRecipients )
19071908
1909+ <a name =" SharingCollection+findByDoctype " ></a >
1910+
1911+ ### sharingCollection.findByDoctype(doctype, [ options] ) ⇒ <code >object</code >
1912+ Finds all sharings for a given doctype
1913+
1914+ ** Kind** : instance method of [ <code >SharingCollection</code >] ( #SharingCollection )
1915+ ** Returns** : <code >object</code > - The response
1916+
1917+ | Param | Type | Description |
1918+ | --- | --- | --- |
1919+ | doctype | <code >string</code > | The doctype |
1920+ | [ options] | [ <code >SharingRulesOptions</code >] ( #SharingRulesOptions ) | The options |
1921+ | [ options.withSharedDocs] | <code >boolean</code > | If true, the response will include the shared documents |
1922+
19081923<a name =" SharingCollection+get " ></a >
19091924
19101925### sharingCollection.get(id) ⇒ [ <code >Sharing</code >] ( #Sharing )
Original file line number Diff line number Diff line change @@ -54,10 +54,18 @@ const normalizeSharing = normalizeDoctypeJsonApi(SHARING_DOCTYPE)
5454 * `io.cozy.sharings`.
5555 */
5656class SharingCollection extends DocumentCollection {
57- async findByDoctype ( doctype ) {
57+ /**
58+ * Finds all sharings for a given doctype
59+ *
60+ * @param {string } doctype The doctype
61+ * @param {SharingRulesOptions } [options] The options
62+ * @param {boolean } [options.withSharedDocs] If true, the response will include the shared documents
63+ * @returns {object } The response
64+ */
65+ async findByDoctype ( doctype , { withSharedDocs = true } = { } ) {
5866 const resp = await this . stackClient . fetchJSON (
5967 'GET' ,
60- uri `/sharings/doctype/${ doctype } `
68+ uri `/sharings/doctype/${ doctype } ?shared_docs= ${ withSharedDocs } `
6169 )
6270 return {
6371 ...resp ,
You can’t perform that action at this time.
0 commit comments