mirror of
https://github.com/typicode/json-server.git
synced 2025-07-28 12:43:18 +08:00
clean
This commit is contained in:
@ -253,7 +253,6 @@ module.exports = (db, name) => {
|
|||||||
function update (req, res, next) {
|
function update (req, res, next) {
|
||||||
const id = req.params.id
|
const id = req.params.id
|
||||||
let chain = db.get(name)
|
let chain = db.get(name)
|
||||||
console.log(req.body)
|
|
||||||
|
|
||||||
chain = req.method === 'PATCH'
|
chain = req.method === 'PATCH'
|
||||||
? chain.updateById(id, req.body)
|
? chain.updateById(id, req.body)
|
||||||
|
@ -551,7 +551,7 @@ describe('Server', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
describe('PUT /:resource/:id', () => {
|
describe('PUT /:resource/:id', () => {
|
||||||
it.only('should respond with json and replace resource', (done) => {
|
it('should respond with json and replace resource', (done) => {
|
||||||
var post = {id: 1, booleanValue: true, integerValue: 1}
|
var post = {id: 1, booleanValue: true, integerValue: 1}
|
||||||
request(server)
|
request(server)
|
||||||
.put('/posts/1')
|
.put('/posts/1')
|
||||||
|
Reference in New Issue
Block a user