寻宝解散队伍
This commit is contained in:
@@ -75,12 +75,17 @@ export default class ComBattleTeam extends BaseModel {
|
||||
}
|
||||
|
||||
public static async addRole(teamCode: string, roleStatus: RoleStatus, lean = true) {
|
||||
const team = await ComBattleTeamModel.findOneAndUpdate({ teamCode: teamCode }, {$push: {roleIds: roleStatus.roleId, roleStatus}}, {upsert: true, new: true}).lean(lean);
|
||||
const team = await ComBattleTeamModel.findOneAndUpdate({ teamCode }, {$push: {roleIds: roleStatus.roleId, roleStatus}}, {upsert: true, new: true}).lean(lean);
|
||||
return team;
|
||||
}
|
||||
|
||||
public static async removeRole(teamCode: string, roleIdToRm: string, lean = true) {
|
||||
const team = await ComBattleTeamModel.findOneAndUpdate({ teamCode: teamCode }, {$pull: {roleIds: roleIdToRm, roleStatus: {roleId: roleIdToRm}}}, {new: true}).lean(lean);
|
||||
const team = await ComBattleTeamModel.findOneAndUpdate({ teamCode }, {$pull: {roleIds: roleIdToRm, roleStatus: {roleId: roleIdToRm}}}, {new: true}).lean(lean);
|
||||
return team;
|
||||
}
|
||||
|
||||
public static async removeTeam(teamCode: string, lean = true) {
|
||||
const team = await ComBattleTeamModel.findOneAndDelete({ teamCode }).lean(lean);
|
||||
return team;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user