From 79ceb87679941e544f9dfd990123edb5b22fe074 Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Mon, 21 Mar 2022 10:38:14 +0800 Subject: [PATCH] Rewrite get stories by execution and module API. --- api/v1/entries/modulestories.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/api/v1/entries/modulestories.php b/api/v1/entries/modulestories.php index 03a29b2f2f..16ac618148 100644 --- a/api/v1/entries/modulestories.php +++ b/api/v1/entries/modulestories.php @@ -15,16 +15,15 @@ class moduleStoriesEntry extends Entry { $executionID = $this->param('executionID', 0); if(empty($executionID)) return $this->sendError(400, 'Need execution id.'); - $control = $this->loadController('story', 'ajaxGetExecutionStories'); - $control->ajaxGetExecutionStories($executionID, $this->param('productID', 0), $this->param('branchID', 0), $moduleID); + + $control = $this->loadController('execution', 'story'); + $control->story($executionID, 'order_desc', 'byModule', $moduleID); $data = $this->getData(); - $this->loadModel('story'); + $result = []; - foreach($data as $storyID => $storyName) + foreach($data->data->stories as $story) { - if(empty($storyID)) continue; - $story = $this->story->getById($storyID); $result[] = $this->filterFields($story, 'id,title,module,pri,status,stage,estimate'); } return $this->send(200, array('stories' => $result));