From 26b4679b23996d1e5a69cd8615536e3c33443373 Mon Sep 17 00:00:00 2001 From: johnniang Date: Sat, 4 May 2019 11:05:06 +0800 Subject: [PATCH] Refactor paging latest comments --- src/api/comment.js | 12 +++--------- src/components/Tools/HeaderComment.vue | 22 +++++++++++++++++----- src/views/dashboard/Dashboard.vue | 25 +++++++++++++++++++------ 3 files changed, 39 insertions(+), 20 deletions(-) diff --git a/src/api/comment.js b/src/api/comment.js index 12654620..0beada8f 100644 --- a/src/api/comment.js +++ b/src/api/comment.js @@ -4,18 +4,12 @@ const baseUrl = '/api/admin/posts/comments' const commentApi = {} -commentApi.listLatest = () => { +commentApi.listLatest = (top, status) => { return service({ url: `${baseUrl}/latest`, - method: 'get' - }) -} - -commentApi.listLatestByStatus = (top) => { - return service({ - url: `${baseUrl}/latest/AUDITING`, params: { - top: top + top: top, + status: status }, method: 'get' }) diff --git a/src/components/Tools/HeaderComment.vue b/src/components/Tools/HeaderComment.vue index b513bf27..5c180cb2 100644 --- a/src/components/Tools/HeaderComment.vue +++ b/src/components/Tools/HeaderComment.vue @@ -12,7 +12,10 @@