浏览代码

return id for created host

Pouria Ezzati 1 年之前
父节点
当前提交
0fe9600e44
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      server/queries/host.queries.js

+ 1 - 1
server/queries/host.queries.js

@@ -47,7 +47,7 @@ async function add(params) {
       });
   } else {
     // Mysql and sqlite don't support returning but return the inserted id by default
-    const [createdHost] = await knex("hosts").insert(newHost).returning('*');
+    const [createdHost] = await knex("hosts").insert(newHost).returning("id");
     id = createdHost.id;
   }