Skip to content

Commit

Permalink
fix: remove set id (eesast#1423)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzdhybthu authored Aug 27, 2024
1 parent 2a920c4 commit bff0bc9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
5 changes: 3 additions & 2 deletions src/routes/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!){
Expand All @@ -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");
Expand Down
14 changes: 0 additions & 14 deletions src/routes/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit bff0bc9

Please sign in to comment.