Skip to content

Commit d3dba3f

Browse files
committed
Fix bug when modifying server descriptions
1 parent faaf276 commit d3dba3f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/Http/Requests/Api/Application/Servers/UpdateServerDetailsRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function rules(): array
1818
return [
1919
'name' => $rules['name'],
2020
'user' => $rules['owner_id'],
21-
'description' => $rules['description'],
21+
'description' => array_merge(['nullable'], $rules['description']),
2222
];
2323
}
2424

app/Services/Servers/DetailsModificationService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function handle(Server $server, array $data)
7171
$response = $this->repository->setFreshModel($this->getUpdatedModel())->update($server->id, [
7272
'owner_id' => array_get($data, 'owner_id'),
7373
'name' => array_get($data, 'name'),
74-
'description' => array_get($data, 'description', ''),
74+
'description' => array_get($data, 'description') ?? '',
7575
], true, true);
7676

7777
if ((int) array_get($data, 'owner_id', 0) !== (int) $server->owner_id) {

0 commit comments

Comments
 (0)