.
This commit is contained in:
@@ -12,8 +12,10 @@ namespace PartSource.Api.Controllers
|
||||
[Route("[controller]")]
|
||||
public class ErrorController : ControllerBase
|
||||
{
|
||||
[HttpGet]
|
||||
[Route("")]
|
||||
[AllowAnonymous]
|
||||
|
||||
public ActionResult Get()
|
||||
{
|
||||
IExceptionHandlerPathFeature exceptionFeature = HttpContext.Features.Get<IExceptionHandlerPathFeature>();
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||
namespace PartSource.Api.Controllers
|
||||
{
|
||||
[Route("[controller]")]
|
||||
[Route("v1/[controller]")]
|
||||
[ApiController]
|
||||
public class InventoryController : BaseNexpartController
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace PartSource.Api.Controllers
|
||||
[Route("sku/{sku}/storeNumber/{storeNumber}")]
|
||||
public async Task<ActionResult> GetInventory(int sku, int storeNumber)
|
||||
{
|
||||
PartsAvailability inventory = _inventoryService.GetInventory(sku, storeNumber);
|
||||
PartsAvailability inventory = await _inventoryService.GetInventory(sku, storeNumber);
|
||||
|
||||
if (inventory == null)
|
||||
{
|
||||
|
||||
@@ -17,8 +17,8 @@ namespace PartSource.Api.Controllers
|
||||
/// <summary>
|
||||
/// This controller exists to enable legacy support for the old Nexpart-based vehicle lookup.
|
||||
/// </summary>
|
||||
[Obsolete]
|
||||
[Route("vehicles")]
|
||||
[Route("v1/vehicles")]
|
||||
[ApiController]
|
||||
public class LegacyVehiclesController : BaseNexpartController
|
||||
{
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
using PartSource.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PartSource.Data;
|
||||
using PartSource.Data.Dtos;
|
||||
using PartSource.Data.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PartSource.Services
|
||||
{
|
||||
@@ -27,9 +29,9 @@ namespace PartSource.Services
|
||||
return _context.Parts.FirstOrDefault(p => p.Sku == sku);
|
||||
}
|
||||
|
||||
public PartsAvailability GetInventory(int sku, int storeNumber)
|
||||
public async Task<PartsAvailability> GetInventory(int sku, int storeNumber)
|
||||
{
|
||||
return _context.PartAvailabilities.FirstOrDefault(s => s.Store == storeNumber && s.SKU == sku);
|
||||
return await _context.PartAvailabilities.FirstOrDefaultAsync(s => s.Store == storeNumber && s.SKU == sku);
|
||||
}
|
||||
|
||||
public IList<Fitment> GetFitments(FitmentSearchDto fitmentSearchDto)
|
||||
|
||||
Reference in New Issue
Block a user