mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-11-30 23:37:16 +01:00
Fix pin notes with grid icon..
This commit is contained in:
@@ -111,11 +111,11 @@ class NoteController extends Controller {
|
||||
* @param array $attachts
|
||||
* @param bool $pinned
|
||||
* @param array $tags
|
||||
* @param array $shares
|
||||
* @param array $shared_with
|
||||
* @param string $color
|
||||
*/
|
||||
public function update(int $id, string $title, string $content, array $attachts, bool $pinned, array $tags, array $shares, string $color = "#F7EB96"): JSONResponse {
|
||||
$note = $this->noteService->update($this->userId, $id, $title, $content, $attachts, $pinned, $tags, $shares, $color);
|
||||
public function update(int $id, string $title, string $content, array $attachts, bool $pinned, array $tags, array $shared_with, string $color = "#F7EB96"): JSONResponse {
|
||||
$note = $this->noteService->update($this->userId, $id, $title, $content, $attachts, $pinned, $tags, $shared_with, $color);
|
||||
if (is_null($note)) {
|
||||
return new JSONResponse([], Http::STATUS_NOT_FOUND);
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ class NoteService {
|
||||
foreach ($dbShares as $dbShare) {
|
||||
$delete = true;
|
||||
foreach ($shares as $share) {
|
||||
if ($dbShare->getSharedUser() === $share['name']) {
|
||||
if ($dbShare->getSharedUser() === $share['shared_user']) {
|
||||
$delete = false;
|
||||
break;
|
||||
}
|
||||
@@ -272,10 +272,10 @@ class NoteService {
|
||||
|
||||
// Add new shares
|
||||
foreach ($shares as $share) {
|
||||
if (!$this->noteShareMapper->existsByNoteAndUser($id, $share['name'])) {
|
||||
if (!$this->noteShareMapper->existsByNoteAndUser($id, $share['shared_user'])) {
|
||||
$hShare = new NoteShare();
|
||||
$hShare->setNoteId($id);
|
||||
$hShare->setSharedUser($share['name']);
|
||||
$hShare->setSharedUser($share['shared_user']);
|
||||
$this->noteShareMapper->insert($hShare);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user