军团:限制重名
This commit is contained in:
@@ -116,8 +116,8 @@ export default class Guild extends BaseModel {
|
||||
}
|
||||
|
||||
public static async checkName(name: string, serverId: number) {
|
||||
const result: GuildType = await GuildModel.findOne({ name, status: GUILD_STATUS.RUNNING, serverId }).lean();
|
||||
return !!result;
|
||||
const result = await GuildModel.exists({ name, status: GUILD_STATUS.RUNNING, serverId });
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async findByCondition(page: number, showPeopleMax: boolean, name: string, serverId: number) {
|
||||
|
||||
Reference in New Issue
Block a user