From 80175cffdc84ae9e6ee8b8df71f6a7615bcb3145 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 10 Sep 2021 20:44:49 -0700 Subject: [PATCH] Fixed #9969 - added color, show_in_nav, and default_label to status labels API Signed-off-by: snipe --- app/Http/Controllers/Api/StatuslabelsController.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Api/StatuslabelsController.php b/app/Http/Controllers/Api/StatuslabelsController.php index 464ac5d77a..c4e5b4aa10 100644 --- a/app/Http/Controllers/Api/StatuslabelsController.php +++ b/app/Http/Controllers/Api/StatuslabelsController.php @@ -71,6 +71,10 @@ class StatuslabelsController extends Controller $statuslabel->deployable = $statusType['deployable']; $statuslabel->pending = $statusType['pending']; $statuslabel->archived = $statusType['archived']; + $statuslabel->color = $request->input('color'); + $statuslabel->show_in_nav = $request->input('show_in_nav'); + $statuslabel->default_label = $request->input('default_label'); + if ($statuslabel->save()) { return response()->json(Helper::formatStandardApiResponse('success', $statuslabel, trans('admin/statuslabels/message.create.success'))); @@ -111,9 +115,7 @@ class StatuslabelsController extends Controller $request->except('deployable', 'pending','archived'); - if (!$request->filled('type')) { - return response()->json(Helper::formatStandardApiResponse('error', null, 'Status label type is required.')); - } + $statuslabel->fill($request->all()); @@ -121,6 +123,9 @@ class StatuslabelsController extends Controller $statuslabel->deployable = $statusType['deployable']; $statuslabel->pending = $statusType['pending']; $statuslabel->archived = $statusType['archived']; + $statuslabel->color = $request->input('color'); + $statuslabel->show_in_nav = $request->input('show_in_nav'); + $statuslabel->default_label = $request->input('default_label'); if ($statuslabel->save()) { return response()->json(Helper::formatStandardApiResponse('success', $statuslabel, trans('admin/statuslabels/message.update.success')));