1
0
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:
Kamran Ahmed
2023-08-15 00:18:49 +01:00
parent 458396f782
commit 6bc7c2f48c
2 changed files with 11 additions and 1 deletions

View File

@@ -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) {

View File

@@ -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) {