This commit is contained in:
2021-09-05 18:55:38 +01:00
parent 95aae91156
commit 066c038e4d
5 changed files with 59 additions and 43 deletions

View File

@ -249,7 +249,7 @@ namespace isnd.Services
}
}
public async Task<PackageDeletionReport> DeletePackageAsync(string pkgId, string fullVersion, string pkgType)
public async Task<PackageDeletionReport> DeletePackageAsync(string pkgid, string version, string type)
{
// TODO package deletion on disk
var commit = new Commit{
@ -258,9 +258,9 @@ namespace isnd.Services
};
dbContext.Commits.Add(commit);
var pkg = await dbContext.PackageVersions.SingleOrDefaultAsync(
v => v.PackageId == pkgId &&
v.FullString == fullVersion &&
v.Type == pkgType
v => v.PackageId == pkgid &&
v.FullString == version &&
v.Type == type
);
if (pkg == null)
{
@ -271,5 +271,14 @@ namespace isnd.Services
ÛpdateCatalogFor(commit);
return new PackageDeletionReport{ Deleted = true, DeletedVersion = pkg };
}
public async Task<PackageVersion> GetPackageAsync(string pkgid, string version, string type)
{
return await dbContext.PackageVersions.SingleOrDefaultAsync(
v => v.PackageId == pkgid &&
v.FullString == version &&
v.Type == type
);
}
}
}