mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Add API to support link package to repository and unlink it (#33481)
Fix #21062 --------- Co-authored-by: Zettat123 <zettat123@gmail.com>
This commit is contained in:
		| @@ -228,6 +228,11 @@ func SetRepositoryLink(ctx context.Context, packageID, repoID int64) error { | ||||
| 	return err | ||||
| } | ||||
|  | ||||
| func UnlinkRepository(ctx context.Context, packageID int64) error { | ||||
| 	_, err := db.GetEngine(ctx).ID(packageID).Cols("repo_id").Update(&Package{RepoID: 0}) | ||||
| 	return err | ||||
| } | ||||
|  | ||||
| // UnlinkRepositoryFromAllPackages unlinks every package from the repository | ||||
| func UnlinkRepositoryFromAllPackages(ctx context.Context, repoID int64) error { | ||||
| 	_, err := db.GetEngine(ctx).Where("repo_id = ?", repoID).Cols("repo_id").Update(&Package{}) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user