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
53 additions
and
5 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 |
---|---|---|
|
@@ -202,3 +202,27 @@ export function getRewardInfo(newsId) { | |
const url = `/news/${newsId}/rewards/sum`; | ||
return api.get(url, { validateStatus: s => s === 200 }); | ||
} | ||
|
||
/** | ||
* 收藏资讯 | ||
* @author mutoe <[email protected]> | ||
* @export | ||
* @param {number} newsId | ||
* @returns | ||
*/ | ||
export function collectionNews(newsId) { | ||
const url = `/news/${newsId}/collections`; | ||
return api.post(url, { validateStatus: s => s === 201 }); | ||
} | ||
|
||
/** | ||
* 取消收藏资讯 | ||
* @author mutoe <[email protected]> | ||
* @export | ||
* @param {number} newsId | ||
* @returns | ||
*/ | ||
export function uncollectNews(newsId) { | ||
const url = `/news/${newsId}/collections`; | ||
return api.delete(url, { 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
6ff3269
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refer #511