-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(users): new routes to accept invite and list merchants #4591
feat(users): new routes to accept invite and list merchants #4591
Conversation
@@ -752,25 +765,36 @@ async fn handle_new_user_invitation( | |||
})?; | |||
|
|||
let is_email_sent; | |||
// TODO: Adding this to avoid clippy lints, is_token_only parameter to removed when TOTP flows get stablized | |||
let _ = is_token_only; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂
crates/router/src/core/user.rs
Outdated
@@ -1230,6 +1254,39 @@ pub async fn list_merchants_for_user( | |||
)) | |||
} | |||
|
|||
pub async fn list_merchants_to_select_for_user( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can have a better name
crates/router/src/core/user.rs
Outdated
let user_roles = state | ||
.store | ||
.list_user_roles_by_user_id(user_token.user_id.as_str()) | ||
.await | ||
.change_context(UserErrors::InternalServerError)?; | ||
|
||
let merchant_accounts = state | ||
.store | ||
.list_multiple_merchant_accounts( | ||
user_roles | ||
.iter() | ||
.map(|role| role.merchant_id.clone()) | ||
.collect(), | ||
) | ||
.await | ||
.change_context(UserErrors::InternalServerError)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code repetition. Can be solved with traits.
crates/router/src/core/user_role.rs
Outdated
.flatten() | ||
.ok_or(UserErrors::MerchantIdNotFound)?; | ||
|
||
Ok(ApplicationResponse::StatusOk) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use map in above instead of separate response
…efactor * 'main' of github.com:juspay/hyperswitch: chore(version): 2024.05.10.0 fix(router): [NETCETERA] skip sending browser_information in authentication request for app device_channel (#4613) fix(users): Fix bugs caused by the new token only flows (#4607) ci(cypress): Fix card expiry for savecard flows (#4585) refactor(billing): store `payment_method_data_billing` for recurring payments (#4513) feat(users): new routes to accept invite and list merchants (#4591) fix(connector): [BAMBORA] Audit Fixes for Bambora (#4604) fix(connector): [iatapay]handle empty error response in case of 401 (#4291) feat(connector): [Payone] add connector template code (#4469) feat(users): Create API to Verify TOTP (#4597) chore(version): 2024.05.09.0 chore(postman): update Postman collection files fix(core): drop three_dsserver_trans_id from authentication table (#4587) refactor(db): Add TenantId field to the KafkaStore struct (#4512) feat(users): Create `user_key_store` table and `begin_totp` API (#4577) Fix(connector): [BOA/CYBS] make rsync status optional (#4570) fix(users): Correct the condition for `verify_email` flow in decision manger (#4580)
Type of Change
Description
This PR:
Additional Changes
Motivation and Context
Closes #4590
How did you test it?
To accept invite from inside dashboard
Response will be 200 Ok
To get merchant select list
Respnse will be something like
For new user invitation we should send accept_invite from email not reset password email
Response for email feature flag enable:
Also check for what email got sent in inbox.
Checklist
cargo +nightly fmt --all
cargo clippy