Commit 5eb7ded4 authored by Stefan Probst's avatar Stefan Probst
Browse files

fix: don't redirect at all when saving as draft

parent 0e9a8ad1
Pipeline #181560 passed with stage
in 5 minutes and 24 seconds
......@@ -78,7 +78,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if (data.status === 'approved') {
router.push({ pathname: `/${data.category}/${data.persistentId}` })
} else if (data.status === 'draft') {
router.push({ pathname: '/' })
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
} else {
router.push({ pathname: '/success' })
}
......
......@@ -80,7 +80,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if (data.status === 'approved') {
router.push({ pathname: `/${data.category}/${data.persistentId}` })
} else if (data.status === 'draft') {
router.push({ pathname: '/' })
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
} else {
router.push({ pathname: '/success' })
}
......
......@@ -78,7 +78,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if (data.status === 'approved') {
router.push({ pathname: `/${data.category}/${data.persistentId}` })
} else if (data.status === 'draft') {
router.push({ pathname: '/' })
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
} else {
router.push({ pathname: '/success' })
}
......
......@@ -80,7 +80,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if (data.status === 'approved') {
router.push({ pathname: `/${data.category}/${data.persistentId}` })
} else if (data.status === 'draft') {
router.push({ pathname: '/' })
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
} else {
router.push({ pathname: '/success' })
}
......
......@@ -76,7 +76,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if (data.status === 'approved') {
router.push({ pathname: `/${data.category}/${data.persistentId}` })
} else if (data.status === 'draft') {
router.push({ pathname: '/' })
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
} else {
router.push({ pathname: '/success' })
}
......
......@@ -78,7 +78,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if (data.status === 'approved') {
router.push({ pathname: `/${data.category}/${data.persistentId}` })
} else if (data.status === 'draft') {
router.push({ pathname: '/' })
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
} else {
router.push({ pathname: '/success' })
}
......
......@@ -76,7 +76,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if (data.status === 'approved') {
router.push({ pathname: `/${data.category}/${data.persistentId}` })
} else if (data.status === 'draft') {
router.push({ pathname: '/' })
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
} else {
router.push({ pathname: '/success' })
}
......
......@@ -78,7 +78,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if (data.status === 'approved') {
router.push({ pathname: `/${data.category}/${data.persistentId}` })
} else if (data.status === 'draft') {
router.push({ pathname: '/' })
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
} else {
router.push({ pathname: '/success' })
}
......
......@@ -122,7 +122,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if (data.status === 'approved') {
router.push({ pathname: `/${data.category}/${data.persistentId}` })
} else if (data.status === 'draft') {
router.push({ pathname: '/' })
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
} else {
router.push({ pathname: '/success' })
}
......
......@@ -136,7 +136,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if (data.status === 'approved') {
router.push({ pathname: `/${data.category}/${data.persistentId}` })
} else if (data.status === 'draft') {
router.push({ pathname: '/' })
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
} else {
router.push({ pathname: '/success' })
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment