Skip to content
Snippets Groups Projects
Verified Commit a7c3cf66 authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #11270 TIME 0:20 customFields default_values + order by label

parent e1ea2194
No related branches found
No related tags found
No related merge requests found
......@@ -63,9 +63,10 @@ class CustomFieldController
}
$id = CustomFieldModel::create([
'label' => $body['label'],
'type' => $body['type'],
'values' => empty($body['values']) ? null : json_encode($body['values'])
'label' => $body['label'],
'type' => $body['type'],
'values' => empty($body['values']) ? null : json_encode($body['values']),
'default_value' => $body['default_value']
]);
return $response->withStatus(204)->withJson(['customFieldId' => $id]);
......@@ -97,8 +98,9 @@ class CustomFieldController
CustomFieldModel::update([
'set' => [
'label' => $body['label'],
'values' => empty($body['values']) ? null : json_encode($body['values'])
'label' => $body['label'],
'values' => empty($body['values']) ? null : json_encode($body['values']),
'default_value' => $body['default_value']
],
'where' => ['id = ?'],
'data' => [$args['id']]
......
......@@ -29,7 +29,7 @@ class CustomFieldModel
'table' => ['custom_fields'],
'where' => empty($args['where']) ? [] : $args['where'],
'data' => empty($args['data']) ? [] : $args['data'],
'order_by' => empty($args['orderBy']) ? [] : $args['orderBy'],
'order_by' => empty($args['orderBy']) ? ['label'] : $args['orderBy'],
'limit' => empty($args['limit']) ? 0 : $args['limit']
]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment