diff options
author | Denys Konovalov <privat@denyskon.de> | 2023-05-29 11:41:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-29 17:41:35 +0800 |
commit | 275d4b7e3f4595206e5c4b1657d4f6d6969d9ce2 (patch) | |
tree | 4283f97bce56c7783e6c77c380cbe4ce06277720 /routers/api/v1/swagger | |
parent | 245f2c08db34e535576633748fc143bb09097ca8 (diff) | |
download | gitea-275d4b7e3f4595206e5c4b1657d4f6d6969d9ce2.tar.gz gitea-275d4b7e3f4595206e5c4b1657d4f6d6969d9ce2.zip |
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
Diffstat (limited to 'routers/api/v1/swagger')
-rw-r--r-- | routers/api/v1/swagger/options.go | 3 | ||||
-rw-r--r-- | routers/api/v1/swagger/repo.go | 7 |
2 files changed, 10 insertions, 0 deletions
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 @@ -117,6 +117,9 @@ type swaggerParameterBodies struct { EditAttachmentOptions api.EditAttachmentOptions // in:body + ChangeFilesOptions api.ChangeFilesOptions + + // in:body CreateFileOptions api.CreateFileOptions // in:body 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 { |