瀏覽代碼

update method simply returned true, therefore just send back the response asumming it worked

sbkwgh 8 年之前
父節點
當前提交
dea31cd40e
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      routes/settings.js

+ 6 - 1
routes/settings.js

@@ -52,7 +52,11 @@ router.put('/', async (req, res) => {
 		if(validationErrors.length) throw Errors.VALIDAITON_ERROR
 
 		let updatedSettings = await Settings.set(params)
-		res.json(updatedSettings.toJSON())
+
+		res.json({
+			forumName: req.body.forumName,
+			forumDescription: req.body.forumDescription
+		})
 		
 	} catch (e) {
 		if(e === Errors.VALIDAITON_ERROR) {
@@ -61,6 +65,7 @@ router.put('/', async (req, res) => {
 				errors: [validationErrors]
 			})
 		} else {
+			console.log(e)
 			res.status(500)
 			res.json({
 				errors: [Errors.unknown]