diff --git a/client/src/components/UpdateAccountModule.tsx b/client/src/components/UpdateAccountModule.tsx index 4f8eb0a..13d16be 100644 --- a/client/src/components/UpdateAccountModule.tsx +++ b/client/src/components/UpdateAccountModule.tsx @@ -3,7 +3,7 @@ import * as Yup from "yup"; import config from "../config"; import { useEffect, useState } from "react"; import { retrieveUserInformation } from "../security/users"; -import { Button } from "@nextui-org/react"; +import { Accordion, AccordionItem, Button } from "@nextui-org/react"; import { Form, Formik } from "formik"; import NextUIFormikInput from "./NextUIFormikInput"; import { PencilSquareIcon } from "../icons"; @@ -83,89 +83,153 @@ export default function UpdateAccountModule({ phoneNumber: "", }; + const archiveAccount = () => { + axios + .put( + config.serverAddress + "/users/archive/" + userInformation.id, + null, + { + headers: { + Authorization: `Bearer ${accessToken}`, + }, + } + ) + .then(() => { + navigate("/login"); + }) + .catch((err) => { + console.log("Archive failed: " + err); + }); + }; + return (