fix: Collection names were incorrect
This commit is contained in:
		
							parent
							
								
									f6ec954c6f
								
							
						
					
					
						commit
						5fa9e6efd6
					
				
					 2 changed files with 7 additions and 3 deletions
				
			
		|  | @ -26,7 +26,9 @@ class DBManagement { | |||
| 	configure (COLLECTION, SCHEMA) { | ||||
| 		this[`schema`] = new Mongoose.Schema(SCHEMA); | ||||
| 		this[`collection`] = COLLECTION; | ||||
| 		this.state.then(() => {this.model = this[`connection`].model(`URL`, this[`schema`]);}) | ||||
| 		this.state.then(() => { | ||||
| 			this.model = this[`connection`].model(this[`collection`], this[`schema`]); | ||||
| 		}) | ||||
| 	} | ||||
| 
 | ||||
| 	/* | ||||
|  | @ -40,7 +42,7 @@ class DBManagement { | |||
| 		await this.state; | ||||
| 		let RESULT = []; | ||||
| 
 | ||||
| 		if ((CRITERIA && CRITERIA instanceof Object) ? !Object.keys(CRITERIA).length : true) { | ||||
| 		if ((CRITERIA && CRITERIA instanceof Object) ? !(Object.keys(CRITERIA).length) : true) { | ||||
| 			RESULT = await this.model.find(); | ||||
| 		} else if (CRITERIA instanceof Object) { | ||||
| 			RESULT = await this.model.find(CRITERIA); | ||||
|  |  | |||
|  | @ -53,4 +53,6 @@ class UsersManagement extends DBManagement { | |||
| 			return (CURRENT); | ||||
| 		}; | ||||
| 	}; | ||||
| } | ||||
| } | ||||
| 
 | ||||
| module.exports = UsersManagement; | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue