Skip to content

Commit fd96afe

Browse files
Merge pull request #221 from sparrowapp-dev/release/2.36.0
Release/2.36.0 to development.
2 parents 21ca160 + 9ef7680 commit fd96afe

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/lib/services/auth.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ const updateOccaisonalUpdatesStatus = async (occaisonalUpdates: OccaisonalUpdate
112112
return response;
113113
};
114114

115-
const acceptTeamInvite = async (teamId: string, inviteId: string) => {
115+
const acceptTeamInvite = async (teamId: string, inviteId: string,email:string) => {
116116
const response = await makeRequest(
117117
'POST',
118-
`${apiUrl}/api/team/${teamId}/invite/user/accept/${inviteId}`,
118+
`${apiUrl}/api/team/${teamId}/invite/user/accept/${inviteId}/email/${email}`,
119119
{
120120
body: {}
121121
}

src/pages/Auth/team-invite-acceptance/TeamInviteAcceptance.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
export let email;
1414
1515
onMount(async () => {
16-
await handleAcceptTeamInvite(teamId, inviteId);
16+
await handleAcceptTeamInvite(teamId, inviteId, email);
1717
isSpinner = false;
1818
});
1919

src/pages/Auth/team-invite-acceptance/team-invite-acceptance.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@ import { notifications } from "$lib/components/toast-notification/ToastNotificat
22
import { acceptTeamInvite } from "$lib/services/auth.service";
33
import { navigate } from "svelte-navigator";
44
export const handleAcceptTeamInvite = async (
5-
teamId: string, inviteId: string
5+
teamId: string, inviteId: string, email: string
66
) => {
7-
const response = await acceptTeamInvite(teamId, inviteId);
7+
const response = await acceptTeamInvite(teamId, inviteId,email);
88
if (response.isSuccessful) {
99
notifications.success("Invitation accepted successfully");
1010
return response;
11+
} else if(response.message === "User is already a member of the hub"){
12+
notifications.warning("You are already a member of this hub");
13+
} else if(response.message === "Plan limit reached."){
14+
notifications.error("The user limit for the Hub Plan has been reached.");
1115
} else {
1216
// window.location.href = 'sparrow://';
1317
notifications.error("Failed to accept invitation");

0 commit comments

Comments
 (0)