some small changes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user