forked from jmug/stoatchat
@@ -28,7 +28,7 @@ pub struct DataOnboard {
|
||||
/// This sets a new username, completes onboarding and allows a user to start using Revolt.
|
||||
#[openapi(tag = "Onboarding")]
|
||||
#[post("/complete", data = "<data>")]
|
||||
pub async fn req(
|
||||
pub async fn complete(
|
||||
db: &State<Database>,
|
||||
session: Session,
|
||||
user: Option<User>,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
use revolt_quark::{authifier::models::Session, models::User};
|
||||
use authifier::models::Session;
|
||||
use revolt_database::User;
|
||||
|
||||
use rocket::serde::json::Json;
|
||||
use serde::Serialize;
|
||||
|
||||
@@ -14,7 +16,7 @@ pub struct DataHello {
|
||||
/// This will tell you whether the current account requires onboarding or whether you can continue to send requests as usual. You may skip calling this if you're restoring an existing session.
|
||||
#[openapi(tag = "Onboarding")]
|
||||
#[get("/hello")]
|
||||
pub async fn req(_session: Session, user: Option<User>) -> Json<DataHello> {
|
||||
pub async fn hello(_session: Session, user: Option<User>) -> Json<DataHello> {
|
||||
Json(DataHello {
|
||||
onboarding: user.is_none(),
|
||||
})
|
||||
|
||||
@@ -5,5 +5,5 @@ mod complete;
|
||||
mod hello;
|
||||
|
||||
pub fn routes() -> (Vec<Route>, OpenApi) {
|
||||
openapi_get_routes_spec![hello::req, complete::req]
|
||||
openapi_get_routes_spec![hello::hello, complete::complete]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user