lrf 2 years ago
parent
commit
5367cd62f7
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/service/user/address.js

+ 2 - 2
app/service/user/address.js

@@ -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();
   }
 }