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)]
|
#[derive(Deserialize, Serialize, Debug)]
|
||||||
struct WolvesResultUser {
|
struct WolvesResultUser {
|
||||||
committee: String,
|
committee: String,
|
||||||
wolves_id: String,
|
member_id: String,
|
||||||
first_name: String,
|
first_name: String,
|
||||||
last_name: String,
|
last_name: String,
|
||||||
contact_email: String,
|
contact_email: String,
|
||||||
|
@ -532,7 +532,7 @@ pub mod get_data {
|
||||||
// list of users that need to be updated for this server
|
// list of users that need to be updated for this server
|
||||||
let mut user_to_update = vec![];
|
let mut user_to_update = vec![];
|
||||||
for user in get_wolves_sub(&config, wolves_api).await {
|
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)) {
|
match existing.get(&(id as i64)) {
|
||||||
None => {
|
None => {
|
||||||
// user does not exist already, add everything
|
// user does not exist already, add everything
|
||||||
|
@ -609,7 +609,7 @@ pub mod get_data {
|
||||||
ON CONFLICT(id_wolves) DO UPDATE SET email = $2
|
ON CONFLICT(id_wolves) DO UPDATE SET email = $2
|
||||||
",
|
",
|
||||||
)
|
)
|
||||||
.bind(&user.wolves_id)
|
.bind(&user.member_id)
|
||||||
.bind(&user.contact_email)
|
.bind(&user.contact_email)
|
||||||
.fetch_optional(db)
|
.fetch_optional(db)
|
||||||
.await
|
.await
|
||||||
|
@ -629,7 +629,7 @@ pub mod get_data {
|
||||||
",
|
",
|
||||||
)
|
)
|
||||||
.bind(*server.as_u64() as i64)
|
.bind(*server.as_u64() as i64)
|
||||||
.bind(&user.wolves_id)
|
.bind(&user.member_id)
|
||||||
.bind(&user.expiry)
|
.bind(&user.expiry)
|
||||||
.fetch_optional(db)
|
.fetch_optional(db)
|
||||||
.await
|
.await
|
||||||
|
|
Loading…
Reference in a new issue