use axum::Json; use axum::extract::{Path, State}; use axum::http::StatusCode; use jwt::extractor::AuthUser; use uuid::Uuid; use crate::error::RepoResult; use crate::features::RepoService; use crate::features::collab::AddCollaboratorOption; #[utoipa::path( put, path = "/repo/{channel_id}/{repo_id}/collaborators/{user_id}", tag = "repo", request_body = AddCollaboratorOption, responses((status = 204, description = "Add or update a collaborator")), security(("bearer_auth" = [])) )] pub(crate) async fn handler( State(svc): State, AuthUser { claims }: AuthUser, Path((_, repo_id, user_id)): Path<(Uuid, Uuid, Uuid)>, Json(input): Json, ) -> RepoResult { svc.add_collaborator(claims.sub, repo_id, user_id, input) .await?; Ok(StatusCode::NO_CONTENT) }