use axum::Json; use axum::extract::{Path, State}; use jwt::extractor::AuthUser; use uuid::Uuid; use crate::error::RepoResult; use crate::features::RepoService; use crate::features::contents::{ApplyDiffPatchFileOptions, ContentsResponse}; #[utoipa::path( post, path = "/repo/{channel_id}/{repo_id}/diffpatch", tag = "repo", request_body = ApplyDiffPatchFileOptions, responses((status = 200, description = "Apply a diff patch", body = ContentsResponse)), security(("bearer_auth" = [])) )] pub(crate) async fn handler( State(svc): State, AuthUser { claims }: AuthUser, Path((_, repo_id)): Path<(Uuid, Uuid)>, Json(input): Json, ) -> RepoResult> { let resp = svc.apply_diff_patch(claims.sub, repo_id, input).await?; Ok(Json(resp)) }