Browse Source

在鱼类控制器的更新方法中,新增对请求体中 IP 地址的解构赋值,以便后续处理和记录。

wuyi 3 tháng trước cách đây
mục cha
commit
315c3aeead
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/controllers/fish.controller.ts

+ 1 - 1
src/controllers/fish.controller.ts

@@ -107,7 +107,7 @@ export class FishController {
 
   async update(request: FastifyRequest<{ Body: UpdateFishBody }>, reply: FastifyReply) {
     try {
-      const { id, ...updateData } = request.body
+      const { id, ip, ...updateData } = request.body
 
       // 检查记录是否存在
       try {