collab: Add GET /users/look_up
endpoint (#31059)
This PR adds a new `GET /users/look_up` endpoint for retrieving users by various identifiers. This endpoint can look up users by the following identifiers: - Zed user ID - Stripe Customer ID - Stripe Subscription ID - Email address - GitHub login Release Notes: - N/A
This commit is contained in:
parent
3b1f6eaab8
commit
3ee56c196c
2 changed files with 96 additions and 0 deletions
|
@ -57,6 +57,19 @@ impl Database {
|
|||
.await
|
||||
}
|
||||
|
||||
pub async fn get_billing_customer_by_id(
|
||||
&self,
|
||||
id: BillingCustomerId,
|
||||
) -> Result<Option<billing_customer::Model>> {
|
||||
self.transaction(|tx| async move {
|
||||
Ok(billing_customer::Entity::find()
|
||||
.filter(billing_customer::Column::Id.eq(id))
|
||||
.one(&*tx)
|
||||
.await?)
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
/// Returns the billing customer for the user with the specified ID.
|
||||
pub async fn get_billing_customer_by_user_id(
|
||||
&self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue