mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-12-01 15:47:17 +01:00
Upgrade to some new nextcloud standards
This commit is contained in:
46
lib/Controller/TagController.php
Normal file
46
lib/Controller/TagController.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Nextcloud - quicknotes
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Matias De lellis <mati86dl@gmail.com>
|
||||
* @copyright Matias De lellis 2019
|
||||
*/
|
||||
|
||||
namespace OCA\QuickNotes\Controller;
|
||||
|
||||
use OCP\IRequest;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\Http\JSONResponse;
|
||||
use OCP\AppFramework\Controller;
|
||||
|
||||
use OCA\QuickNotes\Db\Tag;
|
||||
use OCA\QuickNotes\Db\TagMapper;
|
||||
|
||||
class TagController extends Controller {
|
||||
|
||||
private $tagmapper;
|
||||
private $userId;
|
||||
|
||||
public function __construct($AppName,
|
||||
IRequest $request,
|
||||
TagMapper $tagmapper,
|
||||
$UserId)
|
||||
{
|
||||
parent::__construct($AppName, $request);
|
||||
$this->tagmapper = $tagmapper;
|
||||
$this->userId = $UserId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function index() {
|
||||
$notes = $this->tagmapper->findAll($this->userId);
|
||||
return new DataResponse($notes);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user