refactor(quark): port get/set_settings, get_unreads

#283
This commit is contained in:
Paul Makles
2024-04-07 18:10:11 +01:00
parent f6a565385e
commit 2de7598f8d
11 changed files with 69 additions and 68 deletions

View File

@@ -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>,

View File

@@ -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(),
})

View File

@@ -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]
}