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

parent e1ea2194
......@@ -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']
]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment