From bff0bc92d74986c2ebcefba13853fbc1363f864e Mon Sep 17 00:00:00 2001 From: zzdhyb <139191187+zzdhybthu@users.noreply.github.com> Date: Tue, 27 Aug 2024 10:27:02 +0800 Subject: [PATCH] fix: remove set id (#1423) --- src/routes/application.ts | 5 +++-- src/routes/user.ts | 14 -------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/routes/application.ts b/src/routes/application.ts index eac637bf..9242e6cd 100644 --- a/src/routes/application.ts +++ b/src/routes/application.ts @@ -49,7 +49,6 @@ router.get("/info/honor", async (req, res) => { router.get("/info/mentor", async (req, res) => { try { const year = new Date().getFullYear(); - //在hasura中查询activateIn为year的时间信息 const q_mentor_time: any = await client.request( gql` query MyQuery($activateIn: Int!){ @@ -67,7 +66,9 @@ router.get("/info/mentor", async (req, res) => { } } `, - { activateIn: year } + { + activateIn: year + } ) if (!q_mentor_time?.mentor_time_by_pk) { return res.status(500).send("Error: No mentor time found"); diff --git a/src/routes/user.ts b/src/routes/user.ts index 69c04687..65e13621 100644 --- a/src/routes/user.ts +++ b/src/routes/user.ts @@ -253,20 +253,6 @@ router.post("/register", async(req, res) => { password: password_hash } ); - // graphql mutation, set id to uuid - await client.request( - gql` - mutation MyMutation($uuid: uuid!, $id: String!) { - update_users_by_pk(pk_columns: {uuid: $uuid}, _set: {id: $id}) { - id - } - } - `, - { - uuid: userInsert.insert_users_one.uuid, - id: userInsert.insert_users_one.uuid - } - ); // sign JwtUserPayload token const payload: JwtUserPayload = { uuid: userInsert.insert_users_one.uuid,