|
@@ -18,7 +18,10 @@ class AddressService extends CrudService {
|
|
|
if (is_default !== this.defaultValue) await this.toDefault({ id: data._id });
|
|
|
return data;
|
|
|
}
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 如果数据是第一条数据,则地址为默认地址
|
|
|
+ * @param {Object} data 地址参数
|
|
|
+ */
|
|
|
async beforeCreate(data) {
|
|
|
const { customer } = data;
|
|
|
const num = await this.model.count({ customer });
|