Provide diff and patch API endpoints (#11751)
* Provide diff and patch API endpoints The diff and patch endpoints on the main routes are not accessible by token therefore we provide new API based endpoints for these Fix #10923 Signed-off-by: Andrew Thornton <art27@cantab.net> * placate swagger Signed-off-by: Andrew Thornton <art27@cantab.net> * Make the response an actual string Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
parent
17f8de7a54
commit
f761a37a0f
4 changed files with 182 additions and 0 deletions
|
@ -65,6 +65,10 @@ type APINotFound struct{}
|
|||
// swagger:response redirect
|
||||
type APIRedirect struct{}
|
||||
|
||||
//APIString is a string response
|
||||
// swagger:response string
|
||||
type APIString string
|
||||
|
||||
// Error responds with an error message to client with given obj as the message.
|
||||
// If status is 500, also it prints error to log.
|
||||
func (ctx *APIContext) Error(status int, title string, obj interface{}) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue