Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lbac-1721): prevent back nav to duplicate delegation #804

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions server/src/http/routes/formulaire.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
patchOffre,
provideOffre,
updateFormulaire,
updateOffre,
} from "../../services/formulaire.service"
import { getUser } from "../../services/userRecruteur.service"
import { Server } from "../server"
Expand Down Expand Up @@ -219,7 +218,7 @@ export default (server: Server) => {
// TODO no security ?
},
async (req, res) => {
const result = await updateOffre(req.params.jobId.toString(), req.body)
const result = await patchOffre(req.params.jobId, req.body)
return res.status(200).send(result)
}
)
Expand Down
1 change: 1 addition & 0 deletions shared/routes/formulaire.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export const zFormulaireRoute = {
job_count: true,
job_duration: true,
job_rythm: true,
job_delegation_count: true,
}).extend({
job_start_date: z.coerce.date(),
job_update_date: z.coerce.date(),
Expand Down
5 changes: 3 additions & 2 deletions ui/components/espace_pro/AjouterVoeux.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ const AjouterVoeuxForm = (props) => {
*/
const handleRedirectionAfterSubmit = (form, job, fromDashboard) => {
if (haveProposals) {
return router.push({
return router.replace({
pathname: "/espace-pro/creation/mise-en-relation",
query: { job: JSON.stringify(omit(job, "rome_detail")), email, geo_coordinates: form.geo_coordinates, fromDashboard, userId, establishment_id },
})
}

router.push({
router.replace({
pathname: "/espace-pro/creation/fin",
query: { job: JSON.stringify(omit(job, "rome_detail")), email, withDelegation: false, fromDashboard, userId, establishment_id },
})
Expand Down Expand Up @@ -196,6 +196,7 @@ const AjouterVoeuxForm = (props) => {
job_count: props.job_count ?? 1,
job_duration: props.job_duration ?? 6,
job_rythm: props.job_rythm ?? undefined,
job_delegation_count: props.job_delegation_count ?? 0,
}}
validationSchema={Yup.object().shape({
rome_label: Yup.string().required("Champ obligatoire"),
Expand Down
2 changes: 1 addition & 1 deletion ui/pages/espace-pro/creation/mise-en-relation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function CreationMiseEnRelation() {
}

const goToEndStep = ({ withDelegation }) => {
router.push({
router.replace({
pathname: "/espace-pro/creation/fin",
query: { job: JSON.stringify(job), email, withDelegation, fromDashboard, userId, establishment_id },
})
Expand Down