fix: still working on the pending
This commit is contained in:
parent
abfe92bc87
commit
4c15cab607
@ -34,7 +34,10 @@ onMounted(() => {
|
||||
checkPending(
|
||||
(response) => {
|
||||
const isValidated = response.data === true;
|
||||
if (isValidated && roles.includes("MyINPulse-entrepreneur")) {
|
||||
if (
|
||||
isValidated &&
|
||||
roles.includes("MyINPulse-entrepreneur")
|
||||
) {
|
||||
router.push("/canvas");
|
||||
//router.push("/JorCproject");
|
||||
} else {
|
||||
|
@ -46,6 +46,12 @@ const router = createRouter({
|
||||
name: "finalize",
|
||||
component: () => import("../views/FinalizeAccount.vue"),
|
||||
},
|
||||
|
||||
{
|
||||
path: "/pending-approval",
|
||||
name: "PendingApproval",
|
||||
component: () => import("@/views/PendingApproval.vue"),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
|
@ -123,10 +123,58 @@ function removeSectionCell(
|
||||
});
|
||||
}
|
||||
|
||||
// Checks if the entrepreneur has a pending project request
|
||||
function checkPendingProjectRequest(
|
||||
onSuccessHandler?: (response: AxiosResponse<boolean>) => void,
|
||||
onErrorHandler?: (error: AxiosError) => void
|
||||
): void {
|
||||
axiosInstance
|
||||
.get("/entrepreneur/projects/has-pending-request")
|
||||
.then((response) => {
|
||||
if (onSuccessHandler) {
|
||||
onSuccessHandler(response);
|
||||
} else {
|
||||
defaultApiSuccessHandler(response);
|
||||
}
|
||||
})
|
||||
.catch((error: AxiosError) => {
|
||||
if (onErrorHandler) {
|
||||
onErrorHandler(error);
|
||||
} else {
|
||||
defaultApiErrorHandler(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Checks if the entrepreneur has an active project
|
||||
function checkIfProjectIsActive(
|
||||
onSuccessHandler?: (response: AxiosResponse<boolean>) => void,
|
||||
onErrorHandler?: (error: AxiosError) => void
|
||||
): void {
|
||||
axiosInstance
|
||||
.get("/entrepreneur/projects/project-is-active")
|
||||
.then((response) => {
|
||||
if (onSuccessHandler) {
|
||||
onSuccessHandler(response);
|
||||
} else {
|
||||
defaultApiSuccessHandler(response);
|
||||
}
|
||||
})
|
||||
.catch((error: AxiosError) => {
|
||||
if (onErrorHandler) {
|
||||
onErrorHandler(error);
|
||||
} else {
|
||||
defaultApiErrorHandler(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export {
|
||||
getEntrepreneurProjectId,
|
||||
requestProjectCreation,
|
||||
addSectionCell,
|
||||
modifySectionCell,
|
||||
removeSectionCell,
|
||||
checkPendingProjectRequest,
|
||||
checkIfProjectIsActive,
|
||||
};
|
||||
|
41
front/MyINPulse-front/src/views/PendingApproval.vue
Normal file
41
front/MyINPulse-front/src/views/PendingApproval.vue
Normal file
@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<Header />
|
||||
<div class="pending-container">
|
||||
<h1>Projet en attente de validation</h1>
|
||||
<p>
|
||||
Votre demande de création de projet a bien été reçue.<br />
|
||||
Un administrateur doit valider votre projet avant que vous puissiez
|
||||
continuer.
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Header from "@/components/HeaderComponent.vue";
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.pending-container {
|
||||
max-width: 600px;
|
||||
margin: 100px auto;
|
||||
padding: 2rem;
|
||||
text-align: center;
|
||||
background-color: #fffdf8;
|
||||
border: 1px solid #ececec;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
|
||||
font-family: "Inter", sans-serif;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #f57c00;
|
||||
font-size: 1.8rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 1.1rem;
|
||||
color: #333;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
</style>
|
Loading…
x
Reference in New Issue
Block a user