This repository has been archived by the owner on Nov 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
46 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import api, { get, limit } from "./api.js"; | ||
import api, { limit } from "./api.js"; | ||
import router from "@/routers"; | ||
/** | ||
* 获取 首页动态列表 | ||
|
@@ -39,23 +39,37 @@ export function getFeedsByType(type, limit = 15, after) { | |
* @type {Number} | ||
*/ | ||
export function getCollectedFeed({ limit = 15, offset = 0 }) { | ||
return get("/feeds/collections", { | ||
return api.get("/feeds/collections", { | ||
limit, | ||
offset | ||
}); | ||
} | ||
|
||
// 获取单条动态的评论 | ||
export function getFeedComments({ feedId, after = 0 }) { | ||
return get(`/feeds/${feedId}/comments`, { | ||
return api.get(`/feeds/${feedId}/comments`, { | ||
limit, | ||
after | ||
}); | ||
} | ||
|
||
export function getFeedCommentPinneds(after = 0) { | ||
return get("/user/feed-comment-pinneds", { | ||
return api.get("/user/feed-comment-pinneds", { | ||
limit, | ||
after | ||
}); | ||
} | ||
|
||
/** | ||
* 删除动态评论 | ||
* @author mutoe <[email protected]> | ||
* @export | ||
* @param {Number} feedId | ||
* @param {Number} commentId | ||
* @returns {Promise} | ||
*/ | ||
export function deleteFeedComment(feedId, commentId) { | ||
return api.delete(`/feeds/${feedId}/comments/${commentId}`, { | ||
validateStatus: s => s === 204 | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters