From 275d4b7e3f4595206e5c4b1657d4f6d6969d9ce2 Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Mon, 29 May 2023 11:41:35 +0200 Subject: API endpoint for changing/creating/deleting multiple files (#24887) This PR creates an API endpoint for creating/updating/deleting multiple files in one API call similar to the solution provided by [GitLab](https://docs.gitlab.com/ee/api/commits.html#create-a-commit-with-multiple-files-and-actions). To archive this, the CreateOrUpdateRepoFile and DeleteRepoFIle functions in files service are unified into one function supporting multiple files and actions. Resolves #14619 --- routers/api/v1/swagger/options.go | 3 +++ routers/api/v1/swagger/repo.go | 7 +++++++ 2 files changed, 10 insertions(+) (limited to 'routers/api/v1/swagger') diff --git a/routers/api/v1/swagger/options.go b/routers/api/v1/swagger/options.go index 09bb1d18f3..353d32e214 100644 --- a/routers/api/v1/swagger/options.go +++ b/routers/api/v1/swagger/options.go @@ -116,6 +116,9 @@ type swaggerParameterBodies struct { // in:body EditAttachmentOptions api.EditAttachmentOptions + // in:body + ChangeFilesOptions api.ChangeFilesOptions + // in:body CreateFileOptions api.CreateFileOptions diff --git a/routers/api/v1/swagger/repo.go b/routers/api/v1/swagger/repo.go index 10056ac8cb..3e23aa4d5a 100644 --- a/routers/api/v1/swagger/repo.go +++ b/routers/api/v1/swagger/repo.go @@ -296,6 +296,13 @@ type swaggerFileResponse struct { Body api.FileResponse `json:"body"` } +// FilesResponse +// swagger:response FilesResponse +type swaggerFilesResponse struct { + // in: body + Body api.FilesResponse `json:"body"` +} + // ContentsResponse // swagger:response ContentsResponse type swaggerContentsResponse struct { -- cgit v1.2.3