Skip to content

Commit

Permalink
feat(nextcloud): Add deletePermanently method
Browse files Browse the repository at this point in the history
  • Loading branch information
cballevre committed Jul 17, 2024
1 parent 6f0a871 commit 266f043
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/cozy-stack-client/src/NextcloudFilesCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,18 @@ class NextcloudFilesCollection extends DocumentCollection {
throw new FetchError(resp, resp.json())
}

async deletePermanently(file) {
const resp = await this.stackClient.fetch(
'DELETE',
`/remote/nextcloud/${file.cozyMetadata.sourceAccount}${encodePath(
file.path
)}`
)
if (resp.status === 204) {
return resp
}
throw new FetchError(resp, resp.json())
}
}

export { NextcloudFilesCollection, NEXTCLOUD_FILES_DOCTYPE }

0 comments on commit 266f043

Please sign in to comment.