Skip to content

Commit

Permalink
Merge branch 'dev' into #20-Seat-Selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Ultracrepidarianism committed Sep 30, 2022
2 parents 820b2ba + 6bf4cc5 commit 554ea03
Show file tree
Hide file tree
Showing 42 changed files with 1,214 additions and 475 deletions.
33 changes: 33 additions & 0 deletions api-adept/api-adept/Controllers/LanApiController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using api_adept.Models;
using api_adept.Services;
using Microsoft.AspNetCore.Mvc;

namespace api_adept.Controllers
{
[ApiController]
[Route("/api/lan")]
public class LanApiController : AdeptController
{
private ILanService _lanService;
public LanApiController(IUsersService _userService, ILanService lanService) : base(_userService)
{
_lanService = lanService;
}

[HttpGet("current")]
public Lan GetCurrentLan()
{
Lan currentLan = _lanService.GetLatestLan();

return currentLan;
}

[HttpPost("create")]
public Lan Create([FromBody] Lan lan)
{
Lan newLan = _lanService.Create(lan);

return newLan;
}
}
}
3 changes: 0 additions & 3 deletions api-adept/api-adept/Controllers/UsersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
using api_adept.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Net.Http.Headers;
using System.Security.Claims;
using System.Web.Http.Filters;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

Expand Down
22 changes: 0 additions & 22 deletions api-adept/api-adept/Controllers/v1/LanApiController.cs

This file was deleted.

2 changes: 1 addition & 1 deletion api-adept/api-adept/Core/ExceptionMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public async Task Invoke(HttpContext context)
else
{
contextResponse.StatusCode = (int)HttpStatusCode.InternalServerError;
error = new Error { ErrorCode = "ERR_UNHANDLED", Message = "Unhandled Error", Stacktrace = "Unhandled Error" };
error = new Error { ErrorCode = "ERR_UNHANDLED", Message = exception.Message, Stacktrace = exception.StackTrace };
}

await contextResponse.WriteAsync(JsonConvert.SerializeObject(error));
Expand Down
213 changes: 213 additions & 0 deletions api-adept/api-adept/Migrations/20220924025138_LansUpdate.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions api-adept/api-adept/Migrations/20220924025138_LansUpdate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace api_adept.Migrations
{
public partial class LansUpdate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Date",
table: "Lans",
newName: "StartingDate");

migrationBuilder.AddColumn<DateTime>(
name: "InscriptionDate",
table: "Lans",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
}

protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "InscriptionDate",
table: "Lans");

migrationBuilder.RenameColumn(
name: "StartingDate",
table: "Lans",
newName: "Date");
}
}
}
Loading

0 comments on commit 554ea03

Please sign in to comment.