diff --git a/src/controllers/Routes.ts b/src/controllers/Routes.ts index d7e532d..dff5fbd 100644 --- a/src/controllers/Routes.ts +++ b/src/controllers/Routes.ts @@ -27,20 +27,20 @@ export const Routes : Route[] = [ {type: RouteType.GET, path: "/", cb: WelcomeController.HomeMessage, needLogin: false}, // Account controller - {path: "/account/login", cb: AccountController.LoginUser, needLogin: false}, - {path: "/user/connectUSER", cb: AccountController.LoginUser, needLogin: false}, // Legacy + {path: "/account/login", cb: (h) => AccountController.LoginUser(h), needLogin: false}, + {path: "/user/connectUSER", cb: (h) => AccountController.LoginUser(h), needLogin: false}, // Legacy - {path: "/account/logout", cb: AccountController.LogoutUser}, - {path: "/user/disconnectUSER", cb: AccountController.LogoutUser}, // Legacy + {path: "/account/logout", cb: (h) => AccountController.LogoutUser(h)}, + {path: "/user/disconnectUSER", cb: (h) => AccountController.LogoutUser(h)}, // Legacy - {path: "/account/id", cb: AccountController.CurrentUserID}, - {path: "/user/getCurrentUserID", cb: AccountController.CurrentUserID}, // Legacy + {path: "/account/id", cb: (h) => AccountController.CurrentUserID(h)}, + {path: "/user/getCurrentUserID", cb: (h) => AccountController.CurrentUserID(h)}, // Legacy // User controller - {path: "/user/getInfo", cb: UserController.GetSingle, needLogin: false}, - {path: "/user/getInfos", cb: UserController.GetSingle, needLogin: false}, // Legacy + {path: "/user/getInfo", cb: (h) => UserController.GetSingle(h), needLogin: false}, + {path: "/user/getInfos", cb: (h) => UserController.GetSingle(h), needLogin: false}, // Legacy - {path: "/user/getInfoMultiple", cb: UserController.GetMultiple, needLogin: false}, - {path: "/user/getInfosMultiple", cb: UserController.GetMultiple, needLogin: false}, // Legacy + {path: "/user/getInfoMultiple", cb: (h) => UserController.GetMultiple(h), needLogin: false}, + {path: "/user/getInfosMultiple", cb: (h) => UserController.GetMultiple(h), needLogin: false}, // Legacy ] \ No newline at end of file diff --git a/src/controllers/UserController.ts b/src/controllers/UserController.ts index d9bbca6..73f2b64 100644 --- a/src/controllers/UserController.ts +++ b/src/controllers/UserController.ts @@ -20,7 +20,7 @@ export class UserController { if(!user) handler.error(404, "Could not get user data!"); - handler.send(UserController.UserToAPI(user)); + handler.send(this.UserToAPI(user)); } /**