User search and creation
This commit is contained in:
		
							parent
							
								
									5fa9e6efd6
								
							
						
					
					
						commit
						0458e11267
					
				
					 7 changed files with 109 additions and 42 deletions
				
			
		|  | @ -43,6 +43,7 @@ class DBManagement { | |||
| 		let RESULT = []; | ||||
| 
 | ||||
| 		if ((CRITERIA && CRITERIA instanceof Object) ? !(Object.keys(CRITERIA).length) : true) { | ||||
| 			console.log(`Searching all...`); | ||||
| 			RESULT = await this.model.find(); | ||||
| 		} else if (CRITERIA instanceof Object) { | ||||
| 			RESULT = await this.model.find(CRITERIA); | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ class UsersManagement extends DBManagement { | |||
| 		@param {object} OPTIONS the account options | ||||
| 		@return {object} the user data | ||||
| 	*/ | ||||
| 	async create(USERNAME, OPTIONS, done) { | ||||
| 	async create(USERNAME, OPTIONS) { | ||||
| 		await this.state; | ||||
| 
 | ||||
| 		/*  | ||||
|  | @ -47,7 +47,7 @@ class UsersManagement extends DBManagement { | |||
| 		} | ||||
| 
 | ||||
| 		if ((USERNAME) ? USERNAME.trim() : false) { | ||||
| 			let CURRENT = !(await checkMatch()) | ||||
| 			let CURRENT = (await checkMatch()) | ||||
| 			CURRENT = (!CURRENT) ? await createUser() : CURRENT; | ||||
| 			 | ||||
| 			return (CURRENT); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue