various fixes

This commit is contained in:
2023-11-21 14:06:41 +02:00
parent 635ae03b88
commit 09c873c9d5
5 changed files with 10 additions and 13 deletions
+1
View File
@@ -327,6 +327,7 @@ class RecordController extends Controller
uploadFromUrl: ""
);
} else {
$this->recordService->update(
id: $request->input("record.id"),
data: $request->input("record.data"),
+4 -8
View File
@@ -98,8 +98,7 @@ readonly class RecordService
* @throws LucentException
* @throws ValidatorException
*/
public
function update(
public function update(
string $id,
array $data,
string $status = "draft",
@@ -128,7 +127,8 @@ readonly class RecordService
}
if (Status::from($status) === Status::PUBLISHED) {
$errors = $this->recordValidator->check($record->schema, $record->data, $uniqueEdgesCollection);
$errors = $this->recordValidator->check($record->schema, $formattedData, $uniqueEdgesCollection);
if ($errors->isNotEmpty()) {
$this->recordValidator->throwException($errors);
}
@@ -148,9 +148,6 @@ readonly class RecordService
_file: $record->_file,
);
RecordRepo::update($newRecord);
if ($updateEdges) {
EdgeRepo::update($newRecord->id, $uniqueEdgesCollection);
@@ -162,8 +159,7 @@ readonly class RecordService
/**
*/
public
function changeStatusBulk(
public function changeStatusBulk(
string $status,
array $recordsIds,
): void