mirror of
https://github.com/overleaf/overleaf.git
synced 2024-09-16 02:52:31 -04: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) {
|
||||
return next(error)
|
||||
}
|
||||
res.sendStatus(200)
|
||||
next()
|
||||
res.sendStatus(204)
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -57,8 +56,7 @@ module.exports = {
|
|||
if (error != null) {
|
||||
return next(error)
|
||||
}
|
||||
res.sendStatus(200)
|
||||
next()
|
||||
res.sendStatus(204)
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
@ -33,9 +33,9 @@ const deleteDict = () =>
|
|||
})
|
||||
|
||||
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')
|
||||
expect(response.statusCode).to.equal(200)
|
||||
expect(response.statusCode).to.equal(204)
|
||||
})
|
||||
|
||||
it('should return no misspellings after a word is learnt', async () => {
|
||||
|
@ -61,9 +61,9 @@ describe('learning 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')
|
||||
expect(response.statusCode).to.equal(200)
|
||||
expect(response.statusCode).to.equal(204)
|
||||
})
|
||||
|
||||
it('should return misspellings after a word is unlearnt', async () => {
|
||||
|
|
Loading…
Reference in a new issue