|
@@ -24,8 +24,7 @@ class AddressService extends CrudService {
|
|
|
if (!data) throw new BusinessError(ErrorCode.DATA_NOT_EXIST);
|
|
|
const { customer } = data;
|
|
|
await this.model.updateMany({ customer }, { is_default: this.defaultValue });
|
|
|
- data.is_default = '1';
|
|
|
- await data.save();
|
|
|
+ await this.model.updateOne({ _id: id }, { is_default: '1' });
|
|
|
}
|
|
|
}
|
|
|
|