fix old references
This commit is contained in:
parent
9d3fe5f2c2
commit
bb272881fb
@ -10,7 +10,6 @@ class MariaDB {
|
||||
if (!server) Util.fatal(new Error('Missing reference to server!'));
|
||||
if (!config) Util.fatal(new Error('No config options provided!'));
|
||||
|
||||
this.client = server;
|
||||
this.config = config;
|
||||
|
||||
this.pool = null;
|
||||
|
@ -31,13 +31,13 @@ class Endpoint {
|
||||
|
||||
for (const [ method, cb, mw = [] ] of this.methods) {
|
||||
if (typeof method !== 'string') throw new Error(`Invalid method parameter type in Endpoint ${this.name} major path`);
|
||||
this.client.app[method](this.path, ...this.middleware, ...mw, cb);
|
||||
this.server.app[method](this.path, ...this.middleware, ...mw, cb);
|
||||
}
|
||||
|
||||
this.subpaths = [ ...this._subpaths, ...this.subpaths ];
|
||||
for (const [ sub, method, cb, mw = [] ] of this.subpaths) {
|
||||
if (typeof method !== 'string') throw new Error(`Invalid method parameter type in Endpoint ${this.name} subpath ${sub}`);
|
||||
this.client.app[method](this.path + sub, ...this.middleware, ...mw, cb);
|
||||
this.server.app[method](this.path + sub, ...this.middleware, ...mw, cb);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user