lrf %!s(int64=2) %!d(string=hai) anos
pai
achega
a2e40a0017
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      app/service/user/address.js

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

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