mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 04:53:11 +00:00
Add lowercase route aliases for all controllers
- services/api.js uses lowercase routes (/api/workorders, /api/employees, etc.)
- Add matching [Route] attributes to WorkOrder, Employee, Contact, Account, FollowUp, PMSchedule controllers
- Add [HttpGet("{id:int}")] to WorkOrderController for REST-style get by ID
This commit is contained in:
parent
6f8f67735a
commit
60fc933da7
6 changed files with 8 additions and 2 deletions
|
|
@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore;
|
|||
|
||||
[ApiController]
|
||||
[Route("api/Account")]
|
||||
[Route("api/accounts")]
|
||||
public class AccountController : ControllerBase
|
||||
{
|
||||
private readonly ApplicationDbContext _db;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ namespace Api.SeaHavenIndustries.Controllers
|
|||
//[Authorize] // Removed for testing
|
||||
[ApiController]
|
||||
[Route("api/Contact")]
|
||||
[Route("api/contacts")]
|
||||
public class ContactController : Controller
|
||||
{
|
||||
private readonly UserManager<ApplicationUser> _userManager;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore;
|
|||
|
||||
[ApiController]
|
||||
[Route("api/Employee")]
|
||||
[Route("api/employees")]
|
||||
public class EmployeeController : Controller
|
||||
{
|
||||
private readonly ApplicationDbContext _db;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore;
|
|||
|
||||
[ApiController]
|
||||
[Route("api/FollowUp")]
|
||||
[Route("api/followups")]
|
||||
public class FollowUpController : ControllerBase
|
||||
{
|
||||
private readonly ApplicationDbContext _db;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore;
|
|||
|
||||
[ApiController]
|
||||
[Route("api/PMSchedule")]
|
||||
[Route("api/pmschedules")]
|
||||
public class PMScheduleController : ControllerBase
|
||||
{
|
||||
private readonly ApplicationDbContext _db;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ namespace Api.SeaHavenIndustries.Controllers
|
|||
// [Authorize]
|
||||
[ApiController]
|
||||
[Route("api/WorkOrder")]
|
||||
[Route("api/workorders")]
|
||||
public class WorkOrderController : Controller
|
||||
{
|
||||
private readonly UserManager<ApplicationUser> _userManager;
|
||||
|
|
@ -544,8 +545,8 @@ namespace Api.SeaHavenIndustries.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Route("GetWorkorderById")]
|
||||
[HttpGet("{id:int}")]
|
||||
[HttpGet("GetWorkorderById")]
|
||||
public async Task<IActionResult> GetWorkorderById(int id)
|
||||
{
|
||||
var exist = await _db.workOrders.Include(w => w.Locations).Include(w => w.Comments).Include(w => w.Quotes).Where(w => w.Id == id).Select(s => new
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue