|
@@ -55,13 +55,14 @@ class AdminService extends CrudService {
|
|
|
throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到上级的信息');
|
|
|
}
|
|
|
const res = await this.model.create(data);
|
|
|
- const icdata = { user_id: res._id, code, user_name: res.name };
|
|
|
- try {
|
|
|
- const res = await this.inviteCode.create(icdata);
|
|
|
- } catch (error) {
|
|
|
- await this.model.deleteOne({ _id: res._id });
|
|
|
- throw new BusinessError(ErrorCode.DATABASE_FAULT, '该邀请码已被使用,请重新更换邀请码');
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
return res;
|
|
|
}
|
|
|
async delete({ id }) {
|