Return the metrics id from the signup-creation API

Co-authored-by: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld 2022-09-22 14:37:25 -07:00
parent 7a049f1404
commit dac0ce10e5
3 changed files with 37 additions and 22 deletions

View file

@ -396,12 +396,17 @@ async fn get_user_for_invite_code(
Ok(Json(app.db.get_user_for_invite_code(&code).await?))
}
#[derive(Serialize)]
struct CreateSignupResponse {
metrics_id: i32,
}
async fn create_signup(
Json(params): Json<Signup>,
Extension(app): Extension<Arc<AppState>>,
) -> Result<()> {
app.db.create_signup(params).await?;
Ok(())
) -> Result<Json<CreateSignupResponse>> {
let metrics_id = app.db.create_signup(params).await?;
Ok(Json(CreateSignupResponse { metrics_id }))
}
async fn get_waitlist_summary(