Skip to content

Commit

Permalink
Merge branch 'develop' into feature/OPS-247
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianjost committed Mar 4, 2020
2 parents b4a385a + 09a9d16 commit bfc72bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
3 changes: 2 additions & 1 deletion controllers/teams.js
Expand Up @@ -291,6 +291,7 @@ router.get('/', async (req, res, next) => {
team.background = team.color;
team.memberAmount = team.userIds.length;
team.id = team._id;
team.url = `/teams/invitation/accept/${team._id}`;

return team;
});
Expand Down Expand Up @@ -1200,7 +1201,7 @@ router.get('/invitation/accept/:teamId', async (req, res, next) => {
der Nutzer hat nicht die Rechte oder ist schon Mitglied des Teams. `,
err,
);
res.redirect('/teams/');
res.redirect(`/teams/${req.params.teamId}`);
});
});

Expand Down
17 changes: 0 additions & 17 deletions static/scripts/teamOverview.js
@@ -1,21 +1,4 @@
$(document).ready(() => {
$('.section-teamInvitations a').click(function handler(e) {
e.stopPropagation();
e.preventDefault();

const id = $(this).parents('.sc-card-wrapper').data('id');

$.ajax({
url: `/teams/invitation/accept/${id}`,
method: 'GET',
}).done(() => {
$.showNotification('Einladung erfolgreich angenommen', 'success', true);
location.reload();
}).fail(() => {
$.showNotification('Problem beim Akzeptieren der Einladung', 'danger', true);
});
});

$('.btn-member').on('click', function (e) {
e.stopPropagation();
e.preventDefault();
Expand Down

0 comments on commit bfc72bd

Please sign in to comment.