我正在创建一个表单,其中很少有来自 DB 的值,然后我使用 select 将标志从 1 更新为 0,但 app.post 响应正文没有显示任何数据 下面是代码......还有另一种方法app.get 我从中显示数据。
HTML(.HBS 文件):-
<form action="/auth/access" method="POST">
<div class="table-data">
<h4 style = "position:relative; left:80px; top:2px;">Showing user </h4>
<br>
<table style = "position:relative; background-color:white ;width : 1430px;left:5px;" border="1">
<tr>
<th>User Email</th>
<th>User Name</th>
<th>Approval Flag</th>
</tr>
<div>
{{#each accessData}}
{{#if value.Flag}}
<tr>
<td>{{value.User_Email}}</td>
<td>{{value.User_Name}}</td>
<td><select name="approval" id="approval">
<option value= "1">No</option>
<option value= "0" >Yes</option>
</select></td>
</tr>
{{/if}}
{{/each}}
</div>
</table>
<br>
</form>
<form action="/auth/access" method="POST">
<button style = "position:relative; left:80px; top:2px;" type="submit" class="btn btn-primary">SUBMIT</button>
</div>
</form>
app.js:-
app.post('/auth/access',async function(req,res){
console.log(req.body);
/
});