Fix json style
This commit is contained in:
@@ -16,10 +16,12 @@ module.exports.createAward = [
|
||||
const { score, title, desc, expireDate } = req.body;
|
||||
const fixDate = new Date(expireDate)
|
||||
const award = await Award.create({ score, title, desc, expireDate:fixDate })
|
||||
res.status(201).json({
|
||||
msg: _sr.fa.response.success_save,
|
||||
data: award
|
||||
})
|
||||
// res.status(201).json({
|
||||
// msg: _sr.fa.response.success_save,
|
||||
// data: award
|
||||
// })
|
||||
res.status(201).json(award)
|
||||
|
||||
|
||||
}
|
||||
]
|
||||
@@ -72,10 +74,12 @@ module.exports.update =[
|
||||
data.desc = desc;
|
||||
data.expireDate = new Date(expireDate)
|
||||
data.save()
|
||||
res.status(200).json({
|
||||
msg: _sr.fa.response.success_save,
|
||||
data
|
||||
})
|
||||
// res.status(200).json({
|
||||
// msg: _sr.fa.response.success_save,
|
||||
// data
|
||||
// })
|
||||
res.status(201).json(data)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user