@waline/vercel 1.23.4 → 1.23.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waline/vercel",
3
- "version": "1.23.4",
3
+ "version": "1.23.5",
4
4
  "description": "vercel server for waline comment system",
5
5
  "keywords": [
6
6
  "waline",
@@ -51,6 +51,9 @@ module.exports = class extends BaseRest {
51
51
  const storage = this.config('storage');
52
52
  const model = this.service(`storage/${storage}`, table);
53
53
 
54
+ delete data.objectId;
55
+ delete data.createdAt;
56
+ delete data.updatedAt;
54
57
  await model.update(data, { objectId });
55
58
 
56
59
  return this.success();
@@ -11,7 +11,17 @@ module.exports = class extends BaseRest {
11
11
  }
12
12
 
13
13
  async getAction() {
14
- const { page, pageSize } = this.get();
14
+ const { page, pageSize, email } = this.get();
15
+
16
+ if (email) {
17
+ const user = await this.modelInstance.select({ email });
18
+
19
+ if (think.isEmpty(user)) {
20
+ return this.success();
21
+ }
22
+
23
+ return this.success(user[0]);
24
+ }
15
25
 
16
26
  const count = await this.modelInstance.count({});
17
27
  const users = await this.modelInstance.select(
package/src/logic/user.js CHANGED
@@ -17,6 +17,9 @@ module.exports = class extends Base {
17
17
  int: { max: 100 },
18
18
  default: 10,
19
19
  },
20
+ email: {
21
+ string: true,
22
+ },
20
23
  };
21
24
  }
22
25