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
1895
1895
** Kind** : global class
1896
1896
1897
1897
* [ SharingCollection] ( #SharingCollection )
1898
+ * [ .findByDoctype(doctype, [ options] )] ( #SharingCollection+findByDoctype ) ⇒ <code >object</code >
1898
1899
* [ .get(id)] ( #SharingCollection+get ) ⇒ [ <code >Sharing</code >] ( #Sharing )
1899
1900
* [ .fetchSharedDrives()] ( #SharingCollection+fetchSharedDrives ) ⇒ <code >Promise.< ; {data: Array.< ; Sharing> ; }> ; </code >
1900
1901
* [ .create(params)] ( #SharingCollection+create )
@@ -1905,6 +1906,20 @@ Implements the `DocumentCollection` API along with specific methods for
1905
1906
* [ .revokeSelf(sharing)] ( #SharingCollection+revokeSelf )
1906
1907
* [ .revokeAllRecipients(sharing)] ( #SharingCollection+revokeAllRecipients )
1907
1908
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
+
1908
1923
<a name =" SharingCollection+get " ></a >
1909
1924
1910
1925
### 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)
54
54
* `io.cozy.sharings`.
55
55
*/
56
56
class 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 } = { } ) {
58
66
const resp = await this . stackClient . fetchJSON (
59
67
'GET' ,
60
- uri `/sharings/doctype/${ doctype } `
68
+ uri `/sharings/doctype/${ doctype } ?shared_docs= ${ withSharedDocs } `
61
69
)
62
70
return {
63
71
...resp ,
You can’t perform that action at this time.
0 commit comments