Skip to content

Commit

Permalink
Merge pull request #20 from amfoss/revert-13-master
Browse files Browse the repository at this point in the history
Revert "Adds field for discord-id "
  • Loading branch information
he1senbrg authored Nov 21, 2024
2 parents c38a73f + 5852767 commit 11b8181
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion migrations/20241017154637_add_discord_id_field.sql

This file was deleted.

1 change: 0 additions & 1 deletion src/db/member.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ pub struct Member {
pub sex: String,
pub year: i32,
pub macaddress: String,
pub discord_id: String,
}
4 changes: 1 addition & 3 deletions src/graphql/mutations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ impl MutationRoot {
sex: String,
year: i32,
macaddress: String,
discord_id: String,

) -> Result<Member, sqlx::Error> {
let pool = ctx.data::<Arc<PgPool>>().expect("Pool not found in context");



let member = sqlx::query_as::<_, Member>(
"INSERT INTO Member (rollno, name, hostel, email, sex, year, macaddress, discord_id) VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING *"
"INSERT INTO Member (rollno, name, hostel, email, sex, year, macaddress) VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING *"
)
.bind(rollno)
.bind(name)
Expand All @@ -46,7 +45,6 @@ impl MutationRoot {
.bind(sex)
.bind(year)
.bind(macaddress)
.bind(discord_id)
.fetch_one(pool.as_ref())
.await?;

Expand Down

0 comments on commit 11b8181

Please sign in to comment.