update user non-v1 routes

This commit is contained in:
Brandon Thomas committed 2024-04-05 21:53:29 -04:00
1 parent c2908e192e
commit 945c25bae8
3 files changed
+16 -4

No files matched your search

@@ -119,7 +119,7 @@ impl fmt::Display for ProfileError {
#[utoipa::path(
get,
tag = "Users",
path = "/user/{username}/profile",
path = "/v1/user/{username}/profile",
responses(
(status = 200, description = "Get profile", body = UserProfileRecordForResponse),
(status = 404, description = "Not found", body = ProfileError),
@@ -101,7 +101,7 @@ impl std::fmt::Display for EnqueueTTSRequestError {
#[utoipa::path(
post,
tag = "Voice Designer",
path = "/inference/enqueue_tts",
path = "/v1/voice_designer/inference/enqueue_tts",
responses(
(status = 200, description = "Enqueue TTS generically", body = EnqueueTTSRequestSuccessResponse),
(status = 400, description = "Bad input", body = EnqueueTTSRequestError),
@@ -641,8 +641,20 @@ fn add_user_profile_routes<T, B> (app: App<T>) -> App<T>
InitError = (),
>,
{
app.service(
web::scope("/user")
// NB(bt): Modern routes
app.service(web::scope("/v1/user")
.service(web::resource("/{username}/profile")
.route(web::get().to(get_profile_handler))
.route(web::head().to(|| HttpResponse::Ok()))
)
.service(
web::resource("/{username}/edit_profile")
.route(web::post().to(edit_profile_handler))
.route(web::head().to(|| HttpResponse::Ok()))
)
)
// NB(bt): Legacy routes
.service(web::scope("/user")
.service(
web::resource("/{username}/profile")
.route(web::get().to(get_profile_handler))