forked from Skynet/discord-bot
feat: wolves API is changing to be more inclusive
This commit is contained in:
parent
cf2c7683d2
commit
3d925fcfff
1 changed files with 4 additions and 4 deletions
|
@ -481,7 +481,7 @@ pub mod get_data {
|
|||
#[derive(Deserialize, Serialize, Debug)]
|
||||
struct WolvesResultUser {
|
||||
committee: String,
|
||||
wolves_id: String,
|
||||
member_id: String,
|
||||
first_name: String,
|
||||
last_name: String,
|
||||
contact_email: String,
|
||||
|
@ -532,7 +532,7 @@ pub mod get_data {
|
|||
// list of users that need to be updated for this server
|
||||
let mut user_to_update = vec![];
|
||||
for user in get_wolves_sub(&config, wolves_api).await {
|
||||
let id = user.wolves_id.parse::<u64>().unwrap_or_default();
|
||||
let id = user.member_id.parse::<u64>().unwrap_or_default();
|
||||
match existing.get(&(id as i64)) {
|
||||
None => {
|
||||
// user does not exist already, add everything
|
||||
|
@ -609,7 +609,7 @@ pub mod get_data {
|
|||
ON CONFLICT(id_wolves) DO UPDATE SET email = $2
|
||||
",
|
||||
)
|
||||
.bind(&user.wolves_id)
|
||||
.bind(&user.member_id)
|
||||
.bind(&user.contact_email)
|
||||
.fetch_optional(db)
|
||||
.await
|
||||
|
@ -629,7 +629,7 @@ pub mod get_data {
|
|||
",
|
||||
)
|
||||
.bind(*server.as_u64() as i64)
|
||||
.bind(&user.wolves_id)
|
||||
.bind(&user.member_id)
|
||||
.bind(&user.expiry)
|
||||
.fetch_optional(db)
|
||||
.await
|
||||
|
|
Loading…
Reference in a new issue