Move Shared argument at the end..

This commit is contained in:
Matias De lellis
2020-09-19 17:56:15 -03:00
parent 10442c5117
commit 80ed5f59ad
3 changed files with 14 additions and 14 deletions

View File

@@ -137,8 +137,8 @@ class NoteApiController extends ApiController {
* @param string $color * @param string $color
* @param bool $isPinned * @param bool $isPinned
* @param array $tags * @param array $tags
* @param array $sharedWith
* @param array $attachments * @param array $attachments
* @param array $sharedWith
*/ */
public function update(int $id, public function update(int $id,
string $title, string $title,
@@ -146,8 +146,8 @@ class NoteApiController extends ApiController {
string $color, string $color,
bool $isPinned, bool $isPinned,
array $tags, array $tags,
array $sharedWith, array $attachments,
array $attachments): JSONResponse array $sharedWith): JSONResponse
{ {
$note = $this->noteService->update($this->userId, $note = $this->noteService->update($this->userId,
$id, $id,
@@ -156,8 +156,8 @@ class NoteApiController extends ApiController {
$color, $color,
$isPinned, $isPinned,
$tags, $tags,
$sharedWith, $attachments,
$attachments); $sharedWith);
if (is_null($note)) { if (is_null($note)) {
return new JSONResponse([], Http::STATUS_NOT_FOUND); return new JSONResponse([], Http::STATUS_NOT_FOUND);

View File

@@ -129,8 +129,8 @@ class NoteController extends Controller {
* @param string $color * @param string $color
* @param bool $isPinned * @param bool $isPinned
* @param array $tags * @param array $tags
* @param array $sharedWith
* @param array $attachments * @param array $attachments
* @param array $sharedWith
*/ */
public function update(int $id, public function update(int $id,
string $title, string $title,
@@ -138,8 +138,8 @@ class NoteController extends Controller {
string $color, string $color,
bool $isPinned, bool $isPinned,
array $tags, array $tags,
array $sharedWith, array $attachments,
array $attachments): JSONResponse array $sharedWith): JSONResponse
{ {
$note = $this->noteService->update($this->userId, $note = $this->noteService->update($this->userId,
$id, $id,
@@ -148,8 +148,8 @@ class NoteController extends Controller {
$color, $color,
$isPinned, $isPinned,
$tags, $tags,
$sharedWith, $attachments,
$attachments); $sharedWith);
if (is_null($note)) { if (is_null($note)) {
return new JSONResponse([], Http::STATUS_NOT_FOUND); return new JSONResponse([], Http::STATUS_NOT_FOUND);

View File

@@ -211,9 +211,9 @@ class NoteService {
* @param string $content * @param string $content
* @param string $color * @param string $color
* @param bool $isPinned * @param bool $isPinned
* @param array $sharedWith
* @param array $tags * @param array $tags
* @param array $attachments * @param array $attachments
* @param array $sharedWith
*/ */
public function update(string $userId, public function update(string $userId,
int $id, int $id,
@@ -221,9 +221,9 @@ class NoteService {
string $content, string $content,
string $color, string $color,
bool $isPinned, bool $isPinned,
array $sharedWith,
array $tags, array $tags,
array $attachments): ?Note array $attachments,
array $sharedWith): ?Note
{ {
// Get current Note and Color. // Get current Note and Color.
$note = $this->get($userId, $id); $note = $this->get($userId, $id);
@@ -272,7 +272,7 @@ class NoteService {
$dbShares = $this->noteShareMapper->getSharesForNote($id); $dbShares = $this->noteShareMapper->getSharesForNote($id);
foreach ($dbShares as $dbShare) { foreach ($dbShares as $dbShare) {
$delete = true; $delete = true;
foreach ($shares as $share) { foreach ($sharedWith as $share) {
if ($dbShare->getSharedUser() === $share['shared_user']) { if ($dbShare->getSharedUser() === $share['shared_user']) {
$delete = false; $delete = false;
break; break;