forked from NYANDEV/forgejo
Move almost all functions' parameter db.Engine to context.Context (#19748)
* Move almost all functions' parameter db.Engine to context.Context * remove some unnecessary wrap functions
This commit is contained in:
parent
d81e31ad78
commit
fd7d83ace6
232 changed files with 1463 additions and 2108 deletions
|
@ -64,7 +64,7 @@ func uploadAttachment(ctx *context.Context, repoID int64, allowedTypes string) {
|
|||
// DeleteAttachment response for deleting issue's attachment
|
||||
func DeleteAttachment(ctx *context.Context) {
|
||||
file := ctx.FormString("file")
|
||||
attach, err := repo_model.GetAttachmentByUUID(file)
|
||||
attach, err := repo_model.GetAttachmentByUUID(ctx, file)
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusBadRequest, err.Error())
|
||||
return
|
||||
|
@ -85,7 +85,7 @@ func DeleteAttachment(ctx *context.Context) {
|
|||
|
||||
// GetAttachment serve attachements
|
||||
func GetAttachment(ctx *context.Context) {
|
||||
attach, err := repo_model.GetAttachmentByUUID(ctx.Params(":uuid"))
|
||||
attach, err := repo_model.GetAttachmentByUUID(ctx, ctx.Params(":uuid"))
|
||||
if err != nil {
|
||||
if repo_model.IsErrAttachmentNotExist(err) {
|
||||
ctx.Error(http.StatusNotFound)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue