mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Return 204 instead of 200 when [un]learning words
Also remove unnecessary calls to `next()`
This commit is contained in:
parent
7105ee58d3
commit
00d09fd6f5
2 changed files with 6 additions and 8 deletions
|
@ -44,8 +44,7 @@ module.exports = {
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
return next(error)
|
return next(error)
|
||||||
}
|
}
|
||||||
res.sendStatus(200)
|
res.sendStatus(204)
|
||||||
next()
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -57,8 +56,7 @@ module.exports = {
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
return next(error)
|
return next(error)
|
||||||
}
|
}
|
||||||
res.sendStatus(200)
|
res.sendStatus(204)
|
||||||
next()
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,9 @@ const deleteDict = () =>
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('learning words', () => {
|
describe('learning words', () => {
|
||||||
it('should return status 200 when posting a word successfully', async () => {
|
it('should return status 204 when posting a word successfully', async () => {
|
||||||
const response = await learnWord('abcd')
|
const response = await learnWord('abcd')
|
||||||
expect(response.statusCode).to.equal(200)
|
expect(response.statusCode).to.equal(204)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should return no misspellings after a word is learnt', async () => {
|
it('should return no misspellings after a word is learnt', async () => {
|
||||||
|
@ -61,9 +61,9 @@ describe('learning words', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('unlearning words', () => {
|
describe('unlearning words', () => {
|
||||||
it('should return status 200 when posting a word successfully', async () => {
|
it('should return status 204 when posting a word successfully', async () => {
|
||||||
const response = await unlearnWord('anything')
|
const response = await unlearnWord('anything')
|
||||||
expect(response.statusCode).to.equal(200)
|
expect(response.statusCode).to.equal(204)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should return misspellings after a word is unlearnt', async () => {
|
it('should return misspellings after a word is unlearnt', async () => {
|
||||||
|
|
Loading…
Reference in a new issue