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:
Charlie 2018-03-19 22:49:15 +01:00 committed by Franz Liedke
parent 8d74b40e49
commit 0f75139a51

View File

@ -30,6 +30,10 @@ class OrderTagsController implements ControllerInterface
$order = array_get($request->getParsedBody(), 'order');
if ($order === null) {
return new EmptyResponse(422);
}
Tag::query()->update([
'position' => null,
'parent_id' => null