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