SQL-NodeJs-post提交修改信息

学习分享2年前 (2023)更新 bestcyt
489 0 0

编辑保存婚礼请柬地址信息

// 编辑婚礼信息
router.post('/editInformation', async (req, res, next) => {
	let {
		names,
		time,
		seating,
		address,
		latAndLng,
		welcome,
		phoneMale,
		phoneFemale
	} = req.body;
	try {
		let message = await querySql('update informations set names=?,time=?,seating=?,address=?,latAndLng=?,welcome=?,phoneMale=?,phoneFemale=?', [names, time, seating, address, latAndLng, welcome, phoneMale, phoneFemale]);
		res.send({
			code: message.affectedRows ? 200 : 100,
			msg: message.affectedRows ? '保存成功!' : '保存失败!',
		})
	} catch (e) {
		console.log(e)
		next(e)
	}
})

 

SQL-NodeJs-post提交修改信息
© 版权声明

相关文章