diff --git a/packages/api/routes/contacts.ts b/packages/api/routes/contacts.ts index 60c7063..2f1336d 100644 --- a/packages/api/routes/contacts.ts +++ b/packages/api/routes/contacts.ts @@ -71,7 +71,7 @@ async function addContact(req: Request, res: Response) { insertResult ? res.status(200).send(newRelationship) - : res.status(500).send("Failed to create account, already exists"); + : res.status(500).send("Failed to create relationship, already exists"); return; } catch (error) { diff --git a/packages/desktop/src/controller/index.tsx b/packages/desktop/src/controller/index.tsx index ce46ea2..3f9b853 100644 --- a/packages/desktop/src/controller/index.tsx +++ b/packages/desktop/src/controller/index.tsx @@ -52,8 +52,11 @@ const sendContactRequest = async ( idToken: string, otherUserGoogleId: string ) => { + console.log(idToken); + const response = await axios.post( localHost + `/contacts/${otherUserGoogleId}`, + null, { headers: { Authorization: idToken }, } @@ -103,13 +106,6 @@ export function useConversationDetails(otherUserGoogleId: string) { } // =========== MUTATIONS -export function useCreateUser() { - return useMutation(nirvanaApi.user.createUser, { - onSettled: (data, error) => { - return queryClient.invalidateQueries(Querytypes.GET_USER_DETAILS); - }, - }); -} export function useSendContactRequest() { const authTokens = useRecoilValue($authTokens); diff --git a/packages/desktop/src/pages/Login/index.tsx b/packages/desktop/src/pages/Login/index.tsx index 9923e1e..24d8ba3 100644 --- a/packages/desktop/src/pages/Login/index.tsx +++ b/packages/desktop/src/pages/Login/index.tsx @@ -6,8 +6,6 @@ import { useRecoilState, useSetRecoilState } from "recoil"; import { CircularProgress } from "@mui/material"; import { FcGoogle } from "react-icons/fc"; import Logo from "../../components/Logo"; -import { nirvanaApi } from "../../controller/nirvanaApi"; -import { useCreateUser } from "../../controller/index"; export default function Login({ onReady }: { onReady: Function }) { const setAuthTokens = useSetRecoilState($authTokens);