Skip to content

Commit b94adcf

Browse files
committed
Merge branch 'upgrade-dependencies' of https://github.com/kailash360/user-story into add-tests
2 parents ecbb850 + 3422378 commit b94adcf

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
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
@@ -29,7 +29,7 @@ jobs:
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: |

.github/workflows/github-ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
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
@@ -45,5 +45,6 @@ jobs:
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'

src/pages/NewStory.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff 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 ? (

0 commit comments

Comments
 (0)