File tree Expand file tree Collapse file tree 3 files changed +17
-12
lines changed Expand file tree Collapse file tree 3 files changed +17
-12
lines changed Original file line number Diff line number Diff line change 99 runs-on : ubuntu-latest
1010 strategy :
1111 matrix :
12- node-version : [14 .x]
12+ node-version : [16 .x]
1313
1414 steps :
1515 - name : Checkout repository code
2929
3030 - name : Install node modules
3131 if : steps.cache-node-modules.outputs.cache-hit != 'true'
32- run : npm install
32+ run : npm install -f
3333
3434 - name : Build the site
3535 run : |
Original file line number Diff line number Diff line change 1919
2020 - name : Install node_modules
2121 if : steps.cache-node-modules.outputs.cache-hit != 'true'
22- run : npm install
22+ run : npm install -f
2323
2424 - name : Test SCSS
2525 run : npm run test:scss
4545 - name : Test Cypress
4646 uses : cypress-io/github-action@v2
4747 with :
48+ install-command : npm i -f
4849 start : npm start
4950 wait-on : ' http://localhost:3000'
Original file line number Diff line number Diff line change @@ -117,16 +117,20 @@ const NewStory = () => {
117117 }
118118
119119 const onSubmit = async ( data ) => {
120- data . Description = filterDescriptionText ( description )
121- const formData = new FormData ( )
122- formData . append ( 'data' , JSON . stringify ( data ) )
123- if ( attachments . length ) {
124- attachments . forEach ( ( file ) => {
125- formData . append ( 'files.Attachment' , file )
126- } )
120+ try {
121+ data . Description = filterDescriptionText ( description )
122+ const formData = new FormData ( )
123+ formData . append ( 'data' , JSON . stringify ( data ) )
124+ if ( attachments . length ) {
125+ attachments . forEach ( ( file ) => {
126+ formData . append ( 'files.Attachment' , file )
127+ } )
128+ }
129+ await userStory . createStory ( formData )
130+ navigate ( '/' )
131+ } catch ( err ) {
132+ console . log ( err . message )
127133 }
128- await userStory . createStory ( formData )
129- navigate ( '/' )
130134 }
131135
132136 return state . auth ? (
You can’t perform that action at this time.
0 commit comments