fix sharing redirect

This commit is contained in:
Garrett Mills 2019-06-24 14:15:09 -05:00
parent 25a7abb344
commit 2dafb07cea
2 changed files with 5 additions and 1 deletions

View File

@ -261,6 +261,10 @@ class v1 {
project.user_id = target_user.uuid
project.shared_user_ids.push(req.session.auth.uuid)
if ( project.shared_user_ids.includes(req.session.auth.uuid) ){
project.shared_user_ids.splice(project.shared_user_ids.indexOf(target_user.uuid), 1)
}
await project.save()
return res.redirect('/dash/v1')

View File

@ -34,7 +34,7 @@ const index = {
* controller() calls get methods in Flitter controllers
*/
get: {
'/': [ _flitter.controller('Home').welcome ],
'/': [ _flitter.mw('v1:Invite'), _flitter.controller('Home').welcome ],
},
/*