some small changes

This commit is contained in:
Jacob
2024-01-26 09:37:25 -05:00
parent faaa7f79b7
commit 07ecd98be7

View File

@@ -17,6 +17,12 @@ const AccountPage = () => {
const [docsAllowed, setDocsAllowed] = useState(10);
const appUserId = group ? group.appUserId : null;
const [showModal, setShowModal] = useState(false);
const apiUrl =
process.env.NODE_ENV === "development"
? process.env.REACT_APP_API_DEV
: process.env.REACT_APP_API_PROD;
function getDocumentsCount() {
if (!appUserId) {
return;
@@ -37,10 +43,18 @@ const AccountPage = () => {
return null;
}
const handleCancelSub = () => {
const handleCancelSub = async () => {
setShowModal(true);
try {
//API call(s)
let response = await fetch(`${apiUrl}/cancel-subscription`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
appUserId: appUserId,
}),
})
} catch (err) {
console.log(err);
}