mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-21 16:41:24 +02:00
Accept friend request to redirect to friends page
This commit is contained in:
@@ -49,6 +49,11 @@ export function Befriend() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (response.status === 'accepted') {
|
||||||
|
window.location.href = '/account/friends?c=fa';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setUser(response);
|
setUser(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,8 +83,12 @@ export function Befriend() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (response.status === 'accepted') {
|
||||||
|
window.location.href = '/account/friends?c=fa';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setUser(response);
|
setUser(response);
|
||||||
toast.success(successMessage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteFriend(userId: string, successMessage: string) {
|
async function deleteFriend(userId: string, successMessage: string) {
|
||||||
|
@@ -13,6 +13,7 @@ export interface Props {}
|
|||||||
const messageCodes: Record<string, string> = {
|
const messageCodes: Record<string, string> = {
|
||||||
tl: 'Successfully left the team',
|
tl: 'Successfully left the team',
|
||||||
fs: 'Friend request sent',
|
fs: 'Friend request sent',
|
||||||
|
fa: 'Friend request accepted',
|
||||||
};
|
};
|
||||||
|
|
||||||
export function Toaster(props: Props) {
|
export function Toaster(props: Props) {
|
||||||
|
Reference in New Issue
Block a user