Open Kannaj opened 8 years ago
There are a few socket handlers like the below
socket.on('project:check_name',project_check_name)
project_check_name being a function which invokes pg-promise
project_check_name
pg-promise
And a few like the below
socket.on('project:join',function(data,res){ data.username = socket.getAuthToken().username join_project(data) .then(function(result){ res(null,result) }) .catch(function(err){ winston.error('User cant join project : ',err) res('Cant join project') }) })
The second one is more consistent and allows for easier testing. Make all apis consistent
There are a few socket handlers like the below
socket.on('project:check_name',project_check_name)
project_check_name
being a function which invokespg-promise
And a few like the below
The second one is more consistent and allows for easier testing. Make all apis consistent