fix: short_url post to include org_id in path (#4731)

This commit is contained in:
Loakesh Indiran
2024-10-08 18:24:53 +08:00
committed by GitHub
parent 589c009707
commit 1d0cbfd55c
+2 -2
View File
@@ -46,8 +46,8 @@ use crate::service::short_url;
),
tag = "Short Url"
)]
#[post("/short")]
pub async fn shorten(body: web::Bytes) -> Result<HttpResponse, Error> {
#[post("/{org_id}/short")]
pub async fn shorten(_org_id: web::Path<String>, body: web::Bytes) -> Result<HttpResponse, Error> {
let req: config::meta::short_url::ShortenUrlRequest = serde_json::from_slice(&body)?;
match short_url::shorten(&req.original_url).await {
Ok(short_url) => {