From 7fd5f91e15fca428a1282985781bc0015e2680d5 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Thu, 12 Dec 2019 20:11:43 +0800 Subject: [PATCH] refactor: post status update api --- src/api/comment.js | 7 ++----- src/api/post.js | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/api/comment.js b/src/api/comment.js index 98f93a81..3ce3f3b3 100644 --- a/src/api/comment.js +++ b/src/api/comment.js @@ -40,11 +40,8 @@ commentApi.updateStatus = (target, commentId, status) => { commentApi.updateStatusInBatch = (target, ids, status) => { return service({ - url: `${baseUrl}/${target}/comments/status`, - data: { - ids: ids, - status: status - }, + url: `${baseUrl}/${target}/comments/status/${status}`, + data: ids, method: 'put' }) } diff --git a/src/api/post.js b/src/api/post.js index 0ec3c6f7..37a3979a 100644 --- a/src/api/post.js +++ b/src/api/post.js @@ -60,11 +60,8 @@ postApi.updateStatus = (postId, status) => { postApi.updateStatusInBatch = (ids, status) => { return service({ - url: `${baseUrl}/status`, - data: { - ids: ids, - status: status - }, + url: `${baseUrl}/status/${status}`, + data: ids, method: 'put' }) }