refactor: give socket event default `Promise<any>` to prep for testing
authorxangelo <git@xangelo.ca>
Tue, 4 Jul 2023 15:19:05 +0000 (11:19 -0400)
committerxangelo <git@xangelo.ca>
Tue, 4 Jul 2023 15:19:05 +0000 (11:19 -0400)
src/events/profession-changing/server.ts
src/server/socket-event.server.ts

index c57156a96c820f787a8b931ec66a04130970aad1..76625576efbdd056c6538a17f9bd00ae050eed0e 100644 (file)
@@ -8,7 +8,7 @@ const MIN_LEVEL = 25;
 
 export const professionRecruiter: SocketEvent = {
   eventName: EVENT_NAME,
-  handler: (api, data) => {
+  handler: (api, data): Promise<any> => {
 
     let text: string = '';
 
@@ -64,6 +64,8 @@ export const professionRecruiter: SocketEvent = {
     api.socket.emit('city:services:profession_recruitor_windcross', {
       text
     });
+
+    return;
   }
 };
 
index 3206e000c47ae8df621fd2f98b0469a6d91e42cd..a2711f00601524c95ec89b80a9dea275bd6c0074 100644 (file)
@@ -10,5 +10,5 @@ export type API = {
 
 export type SocketEvent = {
   eventName: string;
-  handler: (api: API, data: unknown) => void;
+  handler: (api: API, data: unknown) => Promise<any>;
 }