Removed unnecessary user

This commit is contained in:
Ryan Prather 2024-05-14 09:36:24 -04:00
parent 0a23b3dae3
commit ee9bc8cf4e
2 changed files with 4 additions and 8 deletions

View File

@ -137,7 +137,6 @@ function validateNote() {
const title = document.querySelector('#noteTitle'); const title = document.querySelector('#noteTitle');
const id = document.querySelector('#noteId'); const id = document.querySelector('#noteId');
const psg = document.querySelector('#passage'); const psg = document.querySelector('#passage');
const user = document.querySelector('#user');
if (!isUuidV4Valid(id.value)) { return false; } if (!isUuidV4Valid(id.value)) { return false; }
if (!title.value.length) { return false; } if (!title.value.length) { return false; }
@ -146,7 +145,6 @@ function validateNote() {
if (!parseInt(series.value)) { return false; } if (!parseInt(series.value)) { return false; }
if (!psg.value) { return false; } if (!psg.value) { return false; }
if (!note.value.length) { return false; } if (!note.value.length) { return false; }
if (!user.value) { return false; }
return true; return true;
} }

View File

@ -16,6 +16,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Uid\Uuid;
class AjaxController extends AbstractController class AjaxController extends AbstractController
{ {
@ -268,18 +269,15 @@ class AjaxController extends AbstractController
if (!$note) { if (!$note) {
$note = new Note(); $note = new Note();
$note->setId($data->id); $uuid = Uuid::fromString($data->id);
$note->setId($uuid);
} }
$refs = json_decode(json_encode($data->refs), true); $refs = json_decode(json_encode($data->refs), true);
$series = $emi->getRepository(Series::class)->find($data->series); $series = $emi->getRepository(Series::class)->find($data->series);
$speaker = $emi->getRepository(Speaker::class)->find($data->speaker); $speaker = $emi->getRepository(Speaker::class)->find($data->speaker);
$user = $emi->getRepository(User::class)->findBy(['email' => $data->user]); $user = $this->getUser();
if (is_array($user)) {
$user = $user[0];
}
$note->setUser($user) $note->setUser($user)
->setTitle($data->title) ->setTitle($data->title)