mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	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:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user