Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/files/appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@
'url' => '/api/v1/toggleShowFolder/{key}',
'verb' => 'POST'
],
[
'name' => 'API#getNodeType',
'url' => '/api/v1/quickaccess/get/NodeType',
'verb' => 'GET',
],
]
]
);
Expand Down
12 changes: 12 additions & 0 deletions apps/files/lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,5 +292,17 @@ public function toggleShowFolder(int $show, string $key) {
return $response;
}

/**
* Get sorting-order for custom sorting
*
* @NoAdminRequired
*
* @param String
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* @return String
*/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add @throws NotFoundException because get($folderpath)

/**
* Get the node at $path
*
* @param string $path relative path of the file or folder
* @return \OCP\Files\Node
* @throws \OCP\Files\NotFoundException
* @since 6.0.0
*/
public function get($path);
could throw it.

public function getNodeType($folderpath) {
$node = $this->userFolder->get($folderpath);
return $node->getType();
}

}