mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-11-30 23:37:16 +01:00
Move Shared argument at the end..
This commit is contained in:
@@ -137,8 +137,8 @@ class NoteApiController extends ApiController {
|
||||
* @param string $color
|
||||
* @param bool $isPinned
|
||||
* @param array $tags
|
||||
* @param array $sharedWith
|
||||
* @param array $attachments
|
||||
* @param array $sharedWith
|
||||
*/
|
||||
public function update(int $id,
|
||||
string $title,
|
||||
@@ -146,8 +146,8 @@ class NoteApiController extends ApiController {
|
||||
string $color,
|
||||
bool $isPinned,
|
||||
array $tags,
|
||||
array $sharedWith,
|
||||
array $attachments): JSONResponse
|
||||
array $attachments,
|
||||
array $sharedWith): JSONResponse
|
||||
{
|
||||
$note = $this->noteService->update($this->userId,
|
||||
$id,
|
||||
@@ -156,8 +156,8 @@ class NoteApiController extends ApiController {
|
||||
$color,
|
||||
$isPinned,
|
||||
$tags,
|
||||
$sharedWith,
|
||||
$attachments);
|
||||
$attachments,
|
||||
$sharedWith);
|
||||
|
||||
if (is_null($note)) {
|
||||
return new JSONResponse([], Http::STATUS_NOT_FOUND);
|
||||
|
||||
@@ -129,8 +129,8 @@ class NoteController extends Controller {
|
||||
* @param string $color
|
||||
* @param bool $isPinned
|
||||
* @param array $tags
|
||||
* @param array $sharedWith
|
||||
* @param array $attachments
|
||||
* @param array $sharedWith
|
||||
*/
|
||||
public function update(int $id,
|
||||
string $title,
|
||||
@@ -138,8 +138,8 @@ class NoteController extends Controller {
|
||||
string $color,
|
||||
bool $isPinned,
|
||||
array $tags,
|
||||
array $sharedWith,
|
||||
array $attachments): JSONResponse
|
||||
array $attachments,
|
||||
array $sharedWith): JSONResponse
|
||||
{
|
||||
$note = $this->noteService->update($this->userId,
|
||||
$id,
|
||||
@@ -148,8 +148,8 @@ class NoteController extends Controller {
|
||||
$color,
|
||||
$isPinned,
|
||||
$tags,
|
||||
$sharedWith,
|
||||
$attachments);
|
||||
$attachments,
|
||||
$sharedWith);
|
||||
|
||||
if (is_null($note)) {
|
||||
return new JSONResponse([], Http::STATUS_NOT_FOUND);
|
||||
|
||||
@@ -211,9 +211,9 @@ class NoteService {
|
||||
* @param string $content
|
||||
* @param string $color
|
||||
* @param bool $isPinned
|
||||
* @param array $sharedWith
|
||||
* @param array $tags
|
||||
* @param array $attachments
|
||||
* @param array $sharedWith
|
||||
*/
|
||||
public function update(string $userId,
|
||||
int $id,
|
||||
@@ -221,9 +221,9 @@ class NoteService {
|
||||
string $content,
|
||||
string $color,
|
||||
bool $isPinned,
|
||||
array $sharedWith,
|
||||
array $tags,
|
||||
array $attachments): ?Note
|
||||
array $attachments,
|
||||
array $sharedWith): ?Note
|
||||
{
|
||||
// Get current Note and Color.
|
||||
$note = $this->get($userId, $id);
|
||||
@@ -272,7 +272,7 @@ class NoteService {
|
||||
$dbShares = $this->noteShareMapper->getSharesForNote($id);
|
||||
foreach ($dbShares as $dbShare) {
|
||||
$delete = true;
|
||||
foreach ($shares as $share) {
|
||||
foreach ($sharedWith as $share) {
|
||||
if ($dbShare->getSharedUser() === $share['shared_user']) {
|
||||
$delete = false;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user