style: move /me/servers to /me/guilds
This commit is contained in:
parent
94c4428bb0
commit
55e343507e
2 changed files with 8 additions and 5 deletions
|
@ -1,11 +1,11 @@
|
||||||
//! `/api/v1/me/servers` Contains endpoint related to guild memberships
|
//! `/api/v1/me/guilds` Contains endpoint related to guild memberships
|
||||||
|
|
||||||
use actix_web::{get, web, HttpRequest, HttpResponse};
|
use actix_web::{get, web, HttpRequest, HttpResponse};
|
||||||
|
|
||||||
use crate::{api::v1::auth::check_access_token, error::Error, structs::Me, utils::{get_auth_header, global_checks}, Data};
|
use crate::{api::v1::auth::check_access_token, error::Error, structs::Me, utils::{get_auth_header, global_checks}, Data};
|
||||||
|
|
||||||
|
|
||||||
/// `GET /api/v1/me/servers` Returns all guild memberships in a list
|
/// `GET /api/v1/me/guilds` Returns all guild memberships in a list
|
||||||
///
|
///
|
||||||
/// requires auth: yes
|
/// requires auth: yes
|
||||||
///
|
///
|
||||||
|
@ -27,7 +27,7 @@ use crate::{api::v1::auth::check_access_token, error::Error, structs::Me, utils:
|
||||||
/// ]);
|
/// ]);
|
||||||
/// ```
|
/// ```
|
||||||
/// NOTE: UUIDs in this response are made using `uuidgen`, UUIDs made by the actual backend will be UUIDv7 and have extractable timestamps
|
/// NOTE: UUIDs in this response are made using `uuidgen`, UUIDs made by the actual backend will be UUIDv7 and have extractable timestamps
|
||||||
#[get("/servers")]
|
#[get("/guilds")]
|
||||||
pub async fn get(req: HttpRequest, data: web::Data<Data>) -> Result<HttpResponse, Error> {
|
pub async fn get(req: HttpRequest, data: web::Data<Data>) -> Result<HttpResponse, Error> {
|
||||||
let headers = req.headers();
|
let headers = req.headers();
|
||||||
|
|
|
@ -6,10 +6,13 @@ use crate::{
|
||||||
api::v1::auth::check_access_token, error::Error, structs::Me, utils::{get_auth_header, global_checks}, Data
|
api::v1::auth::check_access_token, error::Error, structs::Me, utils::{get_auth_header, global_checks}, Data
|
||||||
};
|
};
|
||||||
|
|
||||||
mod servers;
|
mod guilds;
|
||||||
|
|
||||||
pub fn web() -> Scope {
|
pub fn web() -> Scope {
|
||||||
web::scope("/me").service(get).service(update)
|
web::scope("/me")
|
||||||
|
.service(get)
|
||||||
|
.service(update)
|
||||||
|
.service(guilds::get)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("")]
|
#[get("")]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue