codemirror insert
This commit is contained in:
@@ -27,7 +27,6 @@ class RecordController extends Controller
|
||||
public function __construct(
|
||||
private readonly RecordService $recordService,
|
||||
private readonly AccountService $accountService,
|
||||
private readonly AuthService $authService,
|
||||
private readonly ChannelService $channelService,
|
||||
private readonly Svelte $svelte,
|
||||
private readonly Query $query,
|
||||
@@ -61,10 +60,12 @@ class RecordController extends Controller
|
||||
], $filter);
|
||||
|
||||
|
||||
|
||||
$skip = data_get($urlParams, "skip") ?? 0;
|
||||
$limit = 30;
|
||||
$records = [];
|
||||
$graphArray = null;
|
||||
|
||||
$graph = $this->query
|
||||
->filter($arguments)
|
||||
->notLinked($request->input("notlinked") ?? "")
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace Lucent\Query;
|
||||
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Lucent\Database\Database;
|
||||
use Lucent\Query\BuilderConverter\BuilderConverter;
|
||||
use Lucent\Query\Filter\AndFilter;
|
||||
|
||||
@@ -78,6 +78,7 @@ final class Query
|
||||
// ->toArray();
|
||||
|
||||
$formattedRecords = $this->formatRecords($resultsRecordsUnique, $resultChildrenEdges, $resultParentEdges);
|
||||
|
||||
$this->reset();
|
||||
return $formattedRecords;
|
||||
|
||||
@@ -94,7 +95,9 @@ final class Query
|
||||
$queryRecords = collect($records)->map(function ($recordData) {
|
||||
|
||||
$record = Record::fromDB($recordData);
|
||||
|
||||
$record->data = $this->inputFormatter->fill($record->schema, $record->data);
|
||||
|
||||
$queryRecord = QueryRecord::fromRecord($record);
|
||||
$queryRecord->isRoot = data_get($recordData, "isRoot") === true;
|
||||
return $queryRecord;
|
||||
|
||||
@@ -16,8 +16,11 @@ class InputFormatter
|
||||
|
||||
public function fill(string $schemaName, RecordData $input): RecordData
|
||||
{
|
||||
|
||||
$schema = $this->channelService->getSchema($schemaName)->get();
|
||||
|
||||
$data = $schema->fields->reduce(fn(array $carry, FieldInterface $field) => $field->format($input->toArray(), $carry), []);
|
||||
|
||||
return new RecordData($data);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ class Markdown implements FieldInterface, RequiredInterface
|
||||
public bool $required = false,
|
||||
public bool $nullable = false,
|
||||
public string $default = "",
|
||||
public array $collections = [],
|
||||
public string $help = "",
|
||||
public ?int $min = null,
|
||||
public ?int $max = null,
|
||||
|
||||
Reference in New Issue
Block a user