@azteam/express 1.2.236 → 1.2.239

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": "@azteam/express",
3
- "version": "1.2.236",
3
+ "version": "1.2.239",
4
4
  "main": "src/index.js",
5
5
  "engines": {
6
6
  "node": ">= 12.0.0",
@@ -209,6 +209,25 @@ class AdminController extends Controller {
209
209
  };
210
210
  }
211
211
 
212
+ putModifyStatusWaitingPublic() {
213
+ return {
214
+ disabled: !this.roles.UPDATE,
215
+ path: '/waiting/:id',
216
+ method: [
217
+ adminRoleMiddleware([this.roles.UPDATE]),
218
+ validateMiddleware(REQUEST_TYPE.PARAMS, rulesId),
219
+ async (req, res) => {
220
+ const item = await this.repository.findOneById(req.params.id);
221
+ if (!item) return res.error(NOT_EXISTS);
222
+
223
+ await item.modifyStatusWaiting(req.user.id);
224
+
225
+ return res.success(item, this.guardResponse, this.allowResponse);
226
+ },
227
+ ],
228
+ };
229
+ }
230
+
212
231
  async afterDelete(item) {
213
232
  return item;
214
233
  }
package/src/validate.js CHANGED
@@ -52,6 +52,7 @@ export const schemaString = (min = 1, max = 255, optional = false) => ({
52
52
  });
53
53
  export const schemaPassword = (optional = false) => ({
54
54
  type: 'string',
55
+ convert: true,
55
56
  min: 6,
56
57
  max: 32,
57
58
  optional,
@@ -86,6 +87,7 @@ export const schemaPhoneNumber = (optional = false) => ({
86
87
  });
87
88
  export const schemaSlug = (optional = false) => ({
88
89
  type: 'string',
90
+ convert: true,
89
91
  pattern: /[A-Za-z0-9_-]+/,
90
92
  lowercase: true,
91
93
  max: 300,