1
1
mirror of https://github.com/go-gitea/gitea synced 2024-07-07 10:35:48 +00:00
gitea/routers/api/v1
Giteabot d6eb6c90f4
fix: update enable_prune even if mirror_interval is not provided (#28905) (#28929)
Backport #28905 by @Anthony-Jhoiro

Currently, the `updateMirror` function which update the mirror interval
and enable prune properties is only executed by the `Edit` function. But
it is only triggered if `opts.MirrorInterval` is not null, even if
`opts.EnablePrune` is not null.

With this patch, it is now possible to update the enable_prune property
with a patch request without modifying the mirror_interval.

## Example request with httpie

### Currently:
**Does nothing**
```bash
http PATCH https://gitea.your-server/api/v1/repos/myOrg/myRepo "enable_prune:=false" -A bearer -a $gitea_token
```

**Updates both properties**
```bash
http PATCH https://gitea.your-server/api/v1/repos/myOrg/myRepo "enable_prune:=false" "mirror_interval=10m" -A bearer -a $gitea_token
```

### With the patch
**Updates enable_prune only**
```bash
http PATCH https://gitea.your-server/api/v1/repos/myOrg/myRepo "enable_prune:=false" -A bearer -a $gitea_token
```

Co-authored-by: Anthony Quéré <47711333+Anthony-Jhoiro@users.noreply.github.com>
2024-01-26 00:14:38 +01:00
..
activitypub More refactoring of db.DefaultContext (#27083) 2023-09-15 06:13:19 +00:00
admin Forbid removing the last admin user (#28337) (#28793) 2024-01-16 01:51:46 +00:00
misc More db.DefaultContext refactor (#27265) (#27347) 2023-09-29 13:35:01 +00:00
notify More db.DefaultContext refactor (#27265) (#27347) 2023-09-29 13:35:01 +00:00
org Delete repos of org when purge delete user (#27273) (#27728) 2023-11-01 10:03:12 +08:00
packages Another round of db.DefaultContext refactor (#27103) (#27262) 2023-09-25 19:24:35 +02:00
repo fix: update enable_prune even if mirror_interval is not provided (#28905) (#28929) 2024-01-26 00:14:38 +01:00
settings Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
swagger refactor(API): refactor secret creation and update functionality (#26751) 2023-08-28 13:08:19 +08:00
user enable system users search via the API (#28013) (#28018) 2023-12-08 21:46:08 +00:00
utils Fix: system webhooks API bug (#28531) (#28666) 2023-12-31 12:53:09 +00:00
api.go Require token for GET subscription endpoint (#28765) (#28768) 2024-01-12 14:51:27 +08:00