@azteam/express 1.2.339 → 1.2.341
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/lib/controller/AdminController.js +2 -1
- package/lib/controller/Controller.js +2 -1
- package/lib/controller/SitemapController.js +3 -2
- package/package.json +1 -1
- package/src/controller/AdminController.js +2 -2
- package/src/controller/Controller.js +2 -2
- package/src/controller/SitemapController.js +3 -3
- /package/{src/template → template}/sitemap/count.ejs +0 -0
- /package/{src/template → template}/sitemap/home.ejs +0 -0
- /package/{src/template → template}/sitemap/index.ejs +0 -0
- /package/{src/template → template}/sitemap/list.ejs +0 -0
|
@@ -41,8 +41,9 @@ var AdminController = /*#__PURE__*/function (_Controller) {
|
|
|
41
41
|
function AdminController(repository) {
|
|
42
42
|
var _this;
|
|
43
43
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
44
|
+
var pathName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
44
45
|
_classCallCheck(this, AdminController);
|
|
45
|
-
_this = _super.call(this, repository);
|
|
46
|
+
_this = _super.call(this, repository, pathName);
|
|
46
47
|
_defineProperty(_assertThisInitialized(_this), "methodGetPaginate", /*#__PURE__*/function () {
|
|
47
48
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, res) {
|
|
48
49
|
var paginateData;
|
|
@@ -13,9 +13,10 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
13
13
|
var Controller = /*#__PURE__*/function () {
|
|
14
14
|
function Controller() {
|
|
15
15
|
var repository = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
16
|
+
var pathName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
16
17
|
_classCallCheck(this, Controller);
|
|
17
18
|
this.name = this.constructor.name.replace('Controller', '');
|
|
18
|
-
this.pathName = (0, _pluralize["default"])(_lodash["default"].snakeCase(this.name));
|
|
19
|
+
this.pathName = pathName || (0, _pluralize["default"])(_lodash["default"].snakeCase(this.name));
|
|
19
20
|
this.repository = repository;
|
|
20
21
|
}
|
|
21
22
|
_createClass(Controller, [{
|
|
@@ -23,14 +23,15 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
23
23
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
24
24
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
25
25
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
|
-
var TEMPLATE_DIR = _path["default"].
|
|
26
|
+
var TEMPLATE_DIR = _path["default"].join(__dirname, '..', '..', 'template/sitemap');
|
|
27
27
|
var SitemapController = /*#__PURE__*/function (_Controller) {
|
|
28
28
|
_inherits(SitemapController, _Controller);
|
|
29
29
|
var _super = _createSuper(SitemapController);
|
|
30
30
|
function SitemapController(repository) {
|
|
31
31
|
var _this;
|
|
32
|
+
var pathName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
32
33
|
_classCallCheck(this, SitemapController);
|
|
33
|
-
_this = _super.call(this, repository);
|
|
34
|
+
_this = _super.call(this, repository, pathName);
|
|
34
35
|
_this.sitemapName = _lodash["default"].camelCase(_this.name);
|
|
35
36
|
return _this;
|
|
36
37
|
}
|
package/package.json
CHANGED
|
@@ -22,8 +22,8 @@ const ALLOW_FIELDS = [
|
|
|
22
22
|
];
|
|
23
23
|
|
|
24
24
|
class AdminController extends Controller {
|
|
25
|
-
constructor(repository, options = {}) {
|
|
26
|
-
super(repository);
|
|
25
|
+
constructor(repository, options = {}, pathName = null) {
|
|
26
|
+
super(repository, pathName);
|
|
27
27
|
|
|
28
28
|
this.roles = {
|
|
29
29
|
EXEC: null,
|
|
@@ -2,10 +2,10 @@ import _ from 'lodash';
|
|
|
2
2
|
import pluralize from 'pluralize';
|
|
3
3
|
|
|
4
4
|
class Controller {
|
|
5
|
-
constructor(repository = null) {
|
|
5
|
+
constructor(repository = null, pathName = null) {
|
|
6
6
|
this.name = this.constructor.name.replace('Controller', '');
|
|
7
7
|
|
|
8
|
-
this.pathName = pluralize(_.snakeCase(this.name));
|
|
8
|
+
this.pathName = pathName || pluralize(_.snakeCase(this.name));
|
|
9
9
|
this.repository = repository;
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -4,11 +4,11 @@ import util from 'util';
|
|
|
4
4
|
|
|
5
5
|
import Controller from './Controller';
|
|
6
6
|
|
|
7
|
-
const TEMPLATE_DIR = path.
|
|
7
|
+
const TEMPLATE_DIR = path.join(__dirname, '..', '..', 'template/sitemap');
|
|
8
8
|
|
|
9
9
|
class SitemapController extends Controller {
|
|
10
|
-
constructor(repository) {
|
|
11
|
-
super(repository);
|
|
10
|
+
constructor(repository, pathName = null) {
|
|
11
|
+
super(repository, pathName);
|
|
12
12
|
this.sitemapName = _.camelCase(this.name);
|
|
13
13
|
}
|
|
14
14
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|