Code Duplication    Length = 10-10 lines in 2 locations

src/Http/Api/IssueController.php 2 locations

@@ 1119-1128 (lines=10) @@
1116
        $res = UserIssueListColumns::where('project_key', $project_key)
1117
            ->where('user', $this->user->id)
1118
            ->first();
1119
        if ($res) {
1120
            $res->columns = $new_columns;
1121
            $res->column_keys = $column_keys;
1122
            $res->save();
1123
        }
1124
        else
1125
        {
1126
            UserIssueListColumns::create([ 'project_key' => $project_key, 'user' => $this->user->id, 'column_keys' => $column_keys, 'columns' => $new_columns ]); 
1127
        }
1128
1129
        $save_for_project = $request->input('save_for_project') ?: false;
1130
        if ($save_for_project && $this->isPermissionAllowed($project_key, 'manage_project')) {
1131
            $res = ProjectIssueListColumns::where('project_key', $project_key)->first();
@@ 1132-1141 (lines=10) @@
1129
        $save_for_project = $request->input('save_for_project') ?: false;
1130
        if ($save_for_project && $this->isPermissionAllowed($project_key, 'manage_project')) {
1131
            $res = ProjectIssueListColumns::where('project_key', $project_key)->first();
1132
            if ($res) {
1133
                $res->columns = $new_columns;
1134
                $res->column_keys = $column_keys;
1135
                $res->save();
1136
            }
1137
            else
1138
            {
1139
                ProjectIssueListColumns::create([ 'project_key' => $project_key, 'column_keys' => $column_keys, 'columns' => $new_columns ]);
1140
            }
1141
        }
1142
1143
        return $this->getDisplayColumns($project_key);
1144
    }