From b90639355dc6ee4b8c670b88c171573fc26e3d4d Mon Sep 17 00:00:00 2001 From: dingguodong Date: Sat, 19 Jun 2021 11:35:15 +0800 Subject: [PATCH] * Reformat codes and prepare for call. --- module/gitlab/model.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/module/gitlab/model.php b/module/gitlab/model.php index db0a24aa17..21a7cc26ec 100644 --- a/module/gitlab/model.php +++ b/module/gitlab/model.php @@ -359,7 +359,6 @@ class gitlabModel extends model $url = sprintf($apiRoot, $apiPath); $response = commonModel::http($url, $postData); return $response; - } /** @@ -466,8 +465,6 @@ class gitlabModel extends model } return false; - - } /** @@ -505,18 +502,21 @@ class gitlabModel extends model $apiRoot = $this->getApiRoot($gitlabID); $apiPath = "/projects/{$projectID}/issues/"; $url = sprintf($apiRoot, $apiPath); - $response = commonModel::http($url, $issue); + $response = json_decode(commonModel::http($url, $issue)); return $response; } - public function pushTask($task, $gitlabID,$projectID) + public function pushTask($gitlabID, $projectID, $task) { $task->label = $this->config->gitlab->taskLabel->name; + $response = $this->apiCreateIssue($gitlabID, $projectID, $task); + return $response; } - public function pushBug($bug, $gitlabID,$projectID) + public function pushBug($gitlabID, $projectID, $bug) { - $bug->label = $this->config->gitlab->bugLabel->name; + $response = $this->apiCreateIssue($gitlabID, $projectID, $bug); + return $response; } }