Skip to content

Commit

Permalink
fix: dispatch userInvite event if succesful
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Feb 13, 2024
1 parent 0399740 commit 17510a4
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ const CoCreateUser = {
}

Crud.socket.send(request).then((response) => {
if (response.success)
document.dispatchEvent(new CustomEvent('inviteUser'));

render({
selector: "[template*='inviteUser']",
data: [{
Expand Down Expand Up @@ -304,15 +307,14 @@ const CoCreateUser = {

if (data.success)
document.dispatchEvent(new CustomEvent('acceptInvite'));
else
render({
selector: "[template*='acceptInvite']",
data: [{
type: 'acceptInvite',
message: data.message,
success: data.success,
}]
});
render({
selector: "[template*='acceptInvite']",
data: [{
type: 'acceptInvite',
message: data.message,
success: data.success,
}]
});
},


Expand Down

0 comments on commit 17510a4

Please sign in to comment.