Skip to content

Commit

Permalink
fix: fixed preselection form url
Browse files Browse the repository at this point in the history
  • Loading branch information
Kariamos committed Jun 28, 2024
1 parent 2e5f310 commit 55c6a4a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/pages/campaigns/components/campaignForm/SurveyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export const SurveyButton = ({ campaign_id }: { campaign_id: string }) => {
<a
href={
hasSurvey()
? `/backoffice/campaigns/preselection-forms/${data.results[0].id}/`
: "/backoffice/campaigns/preselection-forms/new/"
? `/backoffice/preselection-forms/${data.results[0].id}/`
: "/backoffice/preselection-forms/new/"
}
target="_blank"
>
Expand Down
4 changes: 1 addition & 3 deletions src/pages/preselectionForms/components/FormProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,7 @@ const FormProvider = ({
args.body.campaign = parseInt(values.campaign?.value);
const res = await createForm(args);
if (res && "data" in res) {
history.push(
`/backoffice/campaigns/preselection-forms/${res.data.id}`
);
history.push(`/backoffice/preselection-forms/${res.data.id}`);
add({ type: "success", message: "Form saved" });
} else {
const errorCode =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,10 @@ export const FormTableCard = () => {
onClick={(e) => {
if (e.ctrlKey)
window.open(
`/backoffice/campaigns/preselection-forms/${res.id}`,
`/backoffice/preselection-forms/${res.id}`,
"_blank"
);
else
history.push(
`/backoffice/campaigns/preselection-forms/${res.id}`
);
else history.push(`/backoffice/preselection-forms/${res.id}`);
}}
style={{ cursor: "pointer" }}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/preselectionForms/edit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const PreselectionForm = () => {
size="regular"
back={{
text: "Back to list",
navigation: "/backoffice/campaigns/preselection-forms",
navigation: "/backoffice/preselection-forms",
}}
>
<span>{id ? "Edit Preselection Form" : "New Preselection Form"}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/preselectionForms/new/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const PreselectionForm = () => {
size="regular"
back={{
text: "Back to list",
navigation: "/backoffice/campaigns/preselection-forms",
navigation: "/backoffice/preselection-forms",
}}
>
<span>{id ? "Edit Preselection Form" : "New Preselection Form"}</span>
Expand Down

0 comments on commit 55c6a4a

Please sign in to comment.