aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/src
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-08-18 11:10:00 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-08-23 14:03:51 +0200
commit2c9acd5d5d9b99a586ab35d86780cdaf0e94df5e (patch)
tree9e0f53bc7aead84b3313287294cd3bd593bf809d /apps/files_trashbin/src
parentb4e71ad0fb282fbc9981924b9783ae6659a9e4fe (diff)
downloadnextcloud-server-2c9acd5d5d9b99a586ab35d86780cdaf0e94df5e.tar.gz
nextcloud-server-2c9acd5d5d9b99a586ab35d86780cdaf0e94df5e.zip
feat: migrate FileAction from server
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_trashbin/src')
-rw-r--r--apps/files_trashbin/src/actions/restoreAction.ts3
-rw-r--r--apps/files_trashbin/src/services/trashbin.ts8
2 files changed, 4 insertions, 7 deletions
diff --git a/apps/files_trashbin/src/actions/restoreAction.ts b/apps/files_trashbin/src/actions/restoreAction.ts
index ce8b4077195..70b6922dba7 100644
--- a/apps/files_trashbin/src/actions/restoreAction.ts
+++ b/apps/files_trashbin/src/actions/restoreAction.ts
@@ -22,12 +22,11 @@
import { emit } from '@nextcloud/event-bus'
import { generateRemoteUrl } from '@nextcloud/router'
import { getCurrentUser } from '@nextcloud/auth'
-import { Permission, Node, View } from '@nextcloud/files'
+import { Permission, Node, View, registerFileAction, FileAction } from '@nextcloud/files'
import { translate as t } from '@nextcloud/l10n'
import axios from '@nextcloud/axios'
import History from '@mdi/svg/svg/history.svg?raw'
-import { registerFileAction, FileAction } from '../../../files/src/services/FileAction'
import logger from '../../../files/src/logger.js'
registerFileAction(new FileAction({
diff --git a/apps/files_trashbin/src/services/trashbin.ts b/apps/files_trashbin/src/services/trashbin.ts
index 2c4aa373a3f..5e7a31b2448 100644
--- a/apps/files_trashbin/src/services/trashbin.ts
+++ b/apps/files_trashbin/src/services/trashbin.ts
@@ -19,12 +19,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-/* eslint-disable */
-import { getCurrentUser } from '@nextcloud/auth'
import { File, Folder, davParsePermissions, type ContentsWithRoot } from '@nextcloud/files'
import { generateRemoteUrl, generateUrl } from '@nextcloud/router'
-
+import { getCurrentUser } from '@nextcloud/auth'
import type { FileStat, ResponseDataDetailed } from 'webdav'
+
import { getDavNameSpaces, getDavProperties } from '../../../files/src/services/DavProperties'
import client, { rootPath } from './client'
@@ -40,7 +39,6 @@ const data = `<?xml version="1.0"?>
</d:prop>
</d:propfind>`
-
const resultToNode = function(node: FileStat): File | Folder {
const permissions = davParsePermissions(node.props?.permissions)
const owner = getCurrentUser()?.uid as string
@@ -72,7 +70,7 @@ const resultToNode = function(node: FileStat): File | Folder {
: new Folder(nodeData)
}
-export const getContents = async (path: string = '/'): Promise<ContentsWithRoot> => {
+export const getContents = async (path = '/'): Promise<ContentsWithRoot> => {
// TODO: use only one request when webdav-client supports it
// @see https://github.com/perry-mitchell/webdav-client/pull/334
const rootResponse = await client.stat(path, {