fix test errors
API CI/CD / Validate (composer + pint) (push) Successful in 2m47s
API CI/CD / Test (PHPUnit) (push) Failing after 3m8s
API CI/CD / Build frontend assets (push) Failing after 5m22s
API CI/CD / Security audit (push) Failing after 34s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
API CI/CD / Validate (composer + pint) (push) Successful in 2m47s
API CI/CD / Test (PHPUnit) (push) Failing after 3m8s
API CI/CD / Build frontend assets (push) Failing after 5m22s
API CI/CD / Security audit (push) Failing after 34s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
This commit is contained in:
@@ -138,8 +138,14 @@ class NavBuilderService
|
||||
|
||||
public function reorder(array $orders): void
|
||||
{
|
||||
DB::transaction(function (): void {
|
||||
$this->normalizeSortOrdersAlphabetically();
|
||||
DB::transaction(function () use ($orders): void {
|
||||
foreach ($orders as $item) {
|
||||
$id = (int) ($item['id'] ?? 0);
|
||||
$sortOrder = (int) ($item['sort_order'] ?? 0);
|
||||
if ($id > 0) {
|
||||
NavItem::query()->whereKey($id)->update(['sort_order' => $sortOrder]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$this->navbarService->clearCache();
|
||||
|
||||
Reference in New Issue
Block a user