mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-12-01 07:37:18 +01:00
Smal misc fixes...
This commit is contained in:
@@ -37,7 +37,7 @@ class NoteApiController extends ApiController {
|
|||||||
private $userId;
|
private $userId;
|
||||||
|
|
||||||
public function __construct($AppName,
|
public function __construct($AppName,
|
||||||
IRequest $request,
|
IRequest $request,
|
||||||
NoteService $noteService,
|
NoteService $noteService,
|
||||||
$userId)
|
$userId)
|
||||||
{
|
{
|
||||||
@@ -74,7 +74,7 @@ class NoteApiController extends ApiController {
|
|||||||
*
|
*
|
||||||
* @param int $id
|
* @param int $id
|
||||||
*/
|
*/
|
||||||
public function show($id): JSONResponse {
|
public function show(int $id): JSONResponse {
|
||||||
$note = $this->noteService->get($this->userId, $id);
|
$note = $this->noteService->get($this->userId, $id);
|
||||||
if (is_null($note)) {
|
if (is_null($note)) {
|
||||||
return new JSONResponse([], Http::STATUS_NOT_FOUND);
|
return new JSONResponse([], Http::STATUS_NOT_FOUND);
|
||||||
@@ -97,7 +97,7 @@ class NoteApiController extends ApiController {
|
|||||||
* @param string $content
|
* @param string $content
|
||||||
* @param string $color
|
* @param string $color
|
||||||
*/
|
*/
|
||||||
public function create($title, $content, $color = "#F7EB96") {
|
public function create(string $title, string $content, string $color = null) {
|
||||||
$note = $this->noteService->create($this->userId, $title, $content, $color);
|
$note = $this->noteService->create($this->userId, $title, $content, $color);
|
||||||
|
|
||||||
$etag = md5(json_encode($note));
|
$etag = md5(json_encode($note));
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class NoteController extends Controller {
|
|||||||
private $userId;
|
private $userId;
|
||||||
|
|
||||||
public function __construct($AppName,
|
public function __construct($AppName,
|
||||||
IRequest $request,
|
IRequest $request,
|
||||||
NoteService $noteService,
|
NoteService $noteService,
|
||||||
$userId)
|
$userId)
|
||||||
{
|
{
|
||||||
@@ -70,7 +70,7 @@ class NoteController extends Controller {
|
|||||||
*
|
*
|
||||||
* @param int $id
|
* @param int $id
|
||||||
*/
|
*/
|
||||||
public function show($id): JSONResponse {
|
public function show(int $id): JSONResponse {
|
||||||
$note = $this->noteService->get($this->userId, $id);
|
$note = $this->noteService->get($this->userId, $id);
|
||||||
if (is_null($note)) {
|
if (is_null($note)) {
|
||||||
return new JSONResponse([], Http::STATUS_NOT_FOUND);
|
return new JSONResponse([], Http::STATUS_NOT_FOUND);
|
||||||
@@ -91,7 +91,7 @@ class NoteController extends Controller {
|
|||||||
* @param string $content
|
* @param string $content
|
||||||
* @param string $color
|
* @param string $color
|
||||||
*/
|
*/
|
||||||
public function create($title, $content, $color = NULL) {
|
public function create(string $title, string $content, string $color = null) {
|
||||||
$note = $this->noteService->create($this->userId, $title, $content, $color);
|
$note = $this->noteService->create($this->userId, $title, $content, $color);
|
||||||
|
|
||||||
$etag = md5(json_encode($note));
|
$etag = md5(json_encode($note));
|
||||||
@@ -137,4 +137,5 @@ class NoteController extends Controller {
|
|||||||
$this->noteService->destroy($this->userId, $id);
|
$this->noteService->destroy($this->userId, $id);
|
||||||
return new JSONResponse([]);
|
return new JSONResponse([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user