Skip to content
Clone
7f45a05
25 lines 783 B Rust
use axum::extract::{Path, State};
use export::data::{AppResponseData, NoData};
use jwt::extractor::AuthUser;
use uuid::Uuid;
use crate::error::IssueResult;
use crate::features::IssueService;
#[utoipa::path(
delete,
path = "/issues/{channel_id}/pins/{pin_id}",
tag = "issues",
responses((status = 204, description = "Unpin issue")),
security(("bearer_auth" = []))
)]
pub(crate) async fn handler(
State(svc): State<IssueService>,
AuthUser { claims }: AuthUser,
Path((channel_id, pin_id)): Path<(Uuid, Uuid)>,
) -> IssueResult<AppResponseData<NoData>> {
let collection = svc.ensure_default_collection(channel_id).await?;
svc.delete_pin(claims.sub, channel_id, collection.id, pin_id)
.await?;
Ok(AppResponseData::<NoData>::empty())
}