You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
API: PATCH "/repos/{owner}/{repo}" has the following description:
"Edit a repository's properties. Only fields that are set will be changed."
When executing the API without for example "has_wiki" in the body, the wiki is disabled. Similar for other repo units.
I think this is because function UpdateRepositoryUnits in models/repo.go delete all repo_units for the specified repo_id and then inserts the set repo units again. While the function updateRepoUnits in api/v1/repo/repo.go only adds those repo_units it wants to change.
I am not sure if the change should be in the model or in the api function.
The text was updated successfully, but these errors were encountered:
Does xorm support "ON DUPLICATE KEY"? It could be used to solve this issue, instead of deleting everything and inserting, just insert or update if not existing.
Current logic seem to be that all repo_units written at each change, since settings page write everything each time, and also Issues/ExternalTracker and Wiki/ExternalWiki is mutually exclusive so they must be deleted when updated.
[x]
):Description
API: PATCH "/repos/{owner}/{repo}" has the following description:
"Edit a repository's properties. Only fields that are set will be changed."
When executing the API without for example "has_wiki" in the body, the wiki is disabled. Similar for other repo units.
I think this is because function UpdateRepositoryUnits in models/repo.go delete all repo_units for the specified repo_id and then inserts the set repo units again. While the function updateRepoUnits in api/v1/repo/repo.go only adds those repo_units it wants to change.
I am not sure if the change should be in the model or in the api function.
The text was updated successfully, but these errors were encountered: