catalog impl
This commit is contained in:
@ -2,6 +2,7 @@ using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using isnd.Data;
|
||||
using isnd.Data.Catalog;
|
||||
using isnd.Helpers;
|
||||
using isnd.ViewModels;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@ -14,15 +15,17 @@ namespace isnd.Controllers
|
||||
public partial class PackagesController
|
||||
{
|
||||
// Web search
|
||||
public async Task<IActionResult> Index(PackageIndexViewModel model)
|
||||
public async Task<IActionResult> Index(PackageRegistrationIndexViewModel model)
|
||||
{
|
||||
var applicationDbContext = dbContext.Packages.Include(p => p.Versions).Where(
|
||||
p => ( model.Prerelease || p.Versions.Any(v => !v.IsPrerelease))
|
||||
var applicationDbContext = dbContext.Packages.Include(p => p.Versions)
|
||||
.Include(p => p.Owner)
|
||||
.Where(
|
||||
p => (model.Prerelease || p.Versions.Any(v => !v.IsPrerelease))
|
||||
&& ((model.Query == null) || p.Id.StartsWith(model.Query)));
|
||||
model.Data = await applicationDbContext.ToArrayAsync();
|
||||
model.Data = await applicationDbContext.Select(p => p.ToLeave()).ToArrayAsync();
|
||||
return View(model);
|
||||
}
|
||||
|
||||
|
||||
public async Task<IActionResult> Details(string pkgid)
|
||||
{
|
||||
if (pkgid == null)
|
||||
|
Reference in New Issue
Block a user