aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/packages/generic
diff options
context:
space:
mode:
authorJakobDev <jakobdev@gmx.de>2023-09-25 15:17:37 +0200
committerGitHub <noreply@github.com>2023-09-25 13:17:37 +0000
commit7047df36d4c39fefa6464b713c66302aa0038123 (patch)
treea5c471a3e8abf5cabac8de42c0fd8a814df7abf1 /routers/api/packages/generic
parent93bd4351bfb4a2f5f37ecb80d50496d044240e00 (diff)
downloadgitea-7047df36d4c39fefa6464b713c66302aa0038123.tar.gz
gitea-7047df36d4c39fefa6464b713c66302aa0038123.zip
Another round of `db.DefaultContext` refactor (#27103)
Part of #27065 --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Diffstat (limited to 'routers/api/packages/generic')
-rw-r--r--routers/api/packages/generic/generic.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/routers/api/packages/generic/generic.go b/routers/api/packages/generic/generic.go
index c5866ef9c3..30854335c0 100644
--- a/routers/api/packages/generic/generic.go
+++ b/routers/api/packages/generic/generic.go
@@ -89,6 +89,7 @@ func UploadPackage(ctx *context.Context) {
defer buf.Close()
_, _, err = packages_service.CreatePackageOrAddFileToExisting(
+ ctx,
&packages_service.PackageCreationInfo{
PackageInfo: packages_service.PackageInfo{
Owner: ctx.Package.Owner,
@@ -125,6 +126,7 @@ func UploadPackage(ctx *context.Context) {
// DeletePackage deletes the specific generic package.
func DeletePackage(ctx *context.Context) {
err := packages_service.RemovePackageVersionByNameAndVersion(
+ ctx,
ctx.Doer,
&packages_service.PackageInfo{
Owner: ctx.Package.Owner,
@@ -176,7 +178,7 @@ func DeletePackageFile(ctx *context.Context) {
}
if len(pfs) == 1 {
- if err := packages_service.RemovePackageVersion(ctx.Doer, pv); err != nil {
+ if err := packages_service.RemovePackageVersion(ctx, ctx.Doer, pv); err != nil {
apiError(ctx, http.StatusInternalServerError, err)
return
}