Browse Source

确保课堂状态为number类型

yourname 6 months ago
parent
commit
a5913e3fea
1 changed files with 4 additions and 0 deletions
  1. 4 0
      server/routes_classroom_data.ts

+ 4 - 0
server/routes_classroom_data.ts

@@ -26,6 +26,10 @@ export function createClassroomDataRoutes(withAuth: WithAuth) {
       const total = await query.clone().count()
       const data = await query.select('*')
         .limit(pageSize).offset(offset)
+
+      data.forEach((val) => {
+        val['status'] = Number(val['status'])
+      })
       
       return c.json({
         data,