mirror of
https://github.com/flarum/core.git
synced 2025-08-20 23:31:27 +02:00
Fix ordering bug
If an empty request is sent to the /tags/order endpoint, all tags would get moved to secondary tags.
This commit is contained in:
@@ -30,6 +30,10 @@ class OrderTagsController implements ControllerInterface
|
|||||||
|
|
||||||
$order = array_get($request->getParsedBody(), 'order');
|
$order = array_get($request->getParsedBody(), 'order');
|
||||||
|
|
||||||
|
if ($order === null) {
|
||||||
|
return new EmptyResponse(422);
|
||||||
|
}
|
||||||
|
|
||||||
Tag::query()->update([
|
Tag::query()->update([
|
||||||
'position' => null,
|
'position' => null,
|
||||||
'parent_id' => null
|
'parent_id' => null
|
||||||
|
Reference in New Issue
Block a user