added new endpoint
This commit is contained in:
		@@ -43,6 +43,12 @@ class UserService {
 | 
			
		||||
    async getAllGroupsForUser(userId) {
 | 
			
		||||
        return (await db.query("SELECT groups FROM users WHERE id = $1", [userId])).rows[0].groups
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async getById(userId) {
 | 
			
		||||
        let res = (await db.query("SELECT * FROM users WHERE id = $1", [userId]))
 | 
			
		||||
        if (res.rowCount == 0) throw new customError(`getById no user found`, responseCodes.responses.user.not_found)
 | 
			
		||||
        return res.rows[0]
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default new UserService();
 | 
			
		||||
		Reference in New Issue
	
	Block a user