mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-20 16:10:50 +00:00
Add repo mirror sync API endpoint (#1508)
* API: Add repo mirror sync * Correct error message * Change http status to 200
This commit is contained in:
parent
2eeae84cbd
commit
f995bcc87a
2 changed files with 13 additions and 0 deletions
|
@ -269,3 +269,15 @@ func Delete(ctx *context.APIContext) {
|
|||
log.Trace("Repository deleted: %s/%s", owner.Name, repo.Name)
|
||||
ctx.Status(204)
|
||||
}
|
||||
|
||||
// MirrorSync adds a mirrored repository to the sync queue
|
||||
func MirrorSync(ctx *context.APIContext) {
|
||||
repo := ctx.Repo.Repository
|
||||
|
||||
if !ctx.Repo.IsWriter() {
|
||||
ctx.Error(403, "MirrorSync", "Must have write access")
|
||||
}
|
||||
|
||||
go models.MirrorQueue.Add(repo.ID)
|
||||
ctx.Status(200)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue