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