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.
feat(group): (#525) 圈子管理员可以将成员加入或移出黑名单了
- Loading branch information
Showing
6 changed files
with
117 additions
and
12 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 |
---|---|---|
|
@@ -515,3 +515,29 @@ export function unpinnedPost(postId) { | |
const url = `/plus-group/pinned/posts/${postId}/cancel`; | ||
return api.patch(url, {}, { validateStatus: s => s === 201 }); | ||
} | ||
|
||
/** | ||
* 将一个成员加入黑名单 | ||
* @author mutoe <[email protected]> | ||
* @export | ||
* @param {number} groupId | ||
* @param {number} memberId | ||
* @returns | ||
*/ | ||
export function addToBlackList(groupId, memberId) { | ||
const url = `/plus-group/groups/${groupId}/blacklist/${memberId}`; | ||
return api.put(url, {}, { validateStatus: s => s === 201 }); | ||
} | ||
|
||
/** | ||
* 将一个成员移出黑名单 | ||
* @author mutoe <[email protected]> | ||
* @export | ||
* @param {number} groupId | ||
* @param {number} memberId | ||
* @returns | ||
*/ | ||
export function moveoutBlackList(groupId, memberId) { | ||
const url = `/plus-group/groups/${groupId}/blacklist/${memberId}`; | ||
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
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
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
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
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 |
---|---|---|
|
@@ -207,5 +207,27 @@ export default { | |
const { postId, commentId } = payload; | ||
const { data } = await api.deletePostComment(postId, commentId); | ||
return data; | ||
}, | ||
|
||
/** | ||
* 将某个成员加入黑名单 | ||
* @author mutoe <[email protected]> | ||
* @returns | ||
*/ | ||
async addToBlackList(store, payload) { | ||
const { groupId, memberId } = payload; | ||
await api.addToBlackList(groupId, memberId); | ||
return true; | ||
}, | ||
|
||
/** | ||
* 将某个成员移出黑名单 | ||
* @author mutoe <[email protected]> | ||
* @returns | ||
*/ | ||
async moveoutBlackList(store, payload) { | ||
const { groupId, memberId } = payload; | ||
await api.moveoutBlackList(groupId, memberId); | ||
return true; | ||
} | ||
}; |