1
0
Fork 0
forked from forgejo/forgejo

Remove db.DefaultContext in routers/ and cmd/ (#26076)

Now, the only remaining usages of `models.db.DefaultContext` are in
  - `modules`
  - `models`
  - `services`
This commit is contained in:
delvh 2023-07-24 05:47:27 +02:00 committed by GitHub
parent 24c3bb95ac
commit f3d41c61eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 127 additions and 134 deletions

View file

@ -114,7 +114,7 @@ func SearchPackages(ctx *context.Context) {
// EnumeratePackages lists all package names
// https://packagist.org/apidoc#list-packages
func EnumeratePackages(ctx *context.Context) {
ps, err := packages_model.GetPackagesByType(db.DefaultContext, ctx.Package.Owner.ID, packages_model.TypeComposer)
ps, err := packages_model.GetPackagesByType(ctx, ctx.Package.Owner.ID, packages_model.TypeComposer)
if err != nil {
apiError(ctx, http.StatusInternalServerError, err)
return