Skip to content

Commit 92aa9e4

Browse files
committedFeb 25, 2025·
feat: Rename getOrCreateSharedDrivesDirectory
Better name, not a breaking change since it was not merged.
1 parent 542761e commit 92aa9e4

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed
 

‎docs/api/cozy-stack-client.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ files associated to a specific document
785785
* [.findNotSynchronizedDirectories(oauthClient, options)](#FileCollection+findNotSynchronizedDirectories) ⇒ <code>Array.&lt;(object\|IOCozyFolder)&gt;</code>
786786
* [.addNotSynchronizedDirectories(oauthClient, directories)](#FileCollection+addNotSynchronizedDirectories)
787787
* [.removeNotSynchronizedDirectories(oauthClient, directories)](#FileCollection+removeNotSynchronizedDirectories)
788-
* [.getSharedDrivesDirectoryOrCreate()](#FileCollection+getSharedDrivesDirectoryOrCreate)[<code>IOCozyFolder</code>](#IOCozyFolder)
788+
* [.getOrCreateSharedDrivesDirectory()](#FileCollection+getOrCreateSharedDrivesDirectory)[<code>IOCozyFolder</code>](#IOCozyFolder)
789789

790790
<a name="FileCollection+forceFileDownload"></a>
791791

@@ -1272,15 +1272,15 @@ Remove directory synchronization exclusions from an OAuth client — see https:/
12721272
| oauthClient | [<code>OAuthClient</code>](#OAuthClient) | A JSON representing the OAuth client |
12731273
| directories | <code>Array</code> | An array of JSON documents having a `_type` and `_id` field and representing directories. Returns 204 No Content |
12741274

1275-
<a name="FileCollection+getSharedDrivesDirectoryOrCreate"></a>
1275+
<a name="FileCollection+getOrCreateSharedDrivesDirectory"></a>
12761276

1277-
### fileCollection.getSharedDrivesDirectoryOrCreate() ⇒ [<code>IOCozyFolder</code>](#IOCozyFolder)
1278-
Get the Shared Drives directory or create it if it does not exist.
1277+
### fileCollection.getOrCreateSharedDrivesDirectory() ⇒ [<code>IOCozyFolder</code>](#IOCozyFolder)
1278+
Get or create the Shared Drives directory it if it does not exist.
12791279

12801280
The Shared Drives directory is a special directory :
12811281
- its _id is io.cozy.files.shared-drives-dir
1282-
- it contains Nextcloud drives
1283-
- it contains shared drives
1282+
- it can contains Nextcloud shortcuts
1283+
- it can contains shared drives
12841284

12851285
**Kind**: instance method of [<code>FileCollection</code>](#FileCollection)
12861286
**Returns**: [<code>IOCozyFolder</code>](#IOCozyFolder) - Shared Drives directory

‎packages/cozy-stack-client/src/FileCollection.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1369,16 +1369,16 @@ class FileCollection extends DocumentCollection {
13691369
}
13701370

13711371
/**
1372-
* Get the Shared Drives directory or create it if it does not exist.
1372+
* Get or create the Shared Drives directory it if it does not exist.
13731373
*
13741374
* The Shared Drives directory is a special directory :
13751375
* - its _id is io.cozy.files.shared-drives-dir
1376-
* - it contains Nextcloud drives
1377-
* - it contains shared drives
1376+
* - it can contains Nextcloud shortcuts
1377+
* - it can contains shared drives
13781378
*
13791379
* @returns {IOCozyFolder} Shared Drives directory
13801380
*/
1381-
getSharedDrivesDirectoryOrCreate() {
1381+
getOrCreateSharedDrivesDirectory() {
13821382
return this.stackClient.fetchJSON('POST', '/files/shared-drives')
13831383
}
13841384
}

‎packages/cozy-stack-client/src/FileCollection.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2260,9 +2260,9 @@ describe('FileCollection', () => {
22602260
})
22612261
})
22622262

2263-
describe('getSharedDrivesDirectoryOrCreate', () => {
2263+
describe('getOrCreateSharedDrivesDirectory', () => {
22642264
it('should call the right route', async () => {
2265-
await collection.getSharedDrivesDirectoryOrCreate()
2265+
await collection.getOrCreateSharedDrivesDirectory()
22662266

22672267
expect(client.fetchJSON).toHaveBeenCalledWith(
22682268
'POST',

0 commit comments

Comments
 (0)
Please sign in to comment.