diff --git a/common/app/routes/Jobs/components/Preview.jsx b/common/app/routes/Jobs/components/Preview.jsx index a6249e4b2a..9c805266ac 100644 --- a/common/app/routes/Jobs/components/Preview.jsx +++ b/common/app/routes/Jobs/components/Preview.jsx @@ -38,6 +38,7 @@ export default contain( block={ true } className='signup-btn' onClick={ () => { + jobActions.clearSavedForm(); jobActions.saveJobToDb({ goTo: '/jobs/new/check-out', job diff --git a/common/app/routes/Jobs/flux/Actions.js b/common/app/routes/Jobs/flux/Actions.js index d14d83716d..9a979671b4 100644 --- a/common/app/routes/Jobs/flux/Actions.js +++ b/common/app/routes/Jobs/flux/Actions.js @@ -58,6 +58,7 @@ export default Actions({ }, saveForm: null, getSavedForm: null, + clearSavedForm: null, setForm(form) { return { form }; }, @@ -107,6 +108,10 @@ export default Actions({ } }); + jobActions.clearSavedForm.subscribe(() => { + store.remove('newJob'); + }); + jobActions.saveJobToDb.subscribe(({ goTo, job }) => { const appActions = cat.getActions('appActions'); services.create('jobs', { job }, null, (err, job) => { @@ -133,5 +138,6 @@ export default Actions({ err => jobActions.setError(err) ); }); + return jobActions; });