Remove non-needed pageload object

This commit is contained in:
2025-06-27 23:08:22 -07:00
parent 7e7c15fc97
commit fc15ee67eb
2 changed files with 0 additions and 164 deletions
@@ -1,41 +0,0 @@
using MistoxWebsite.Server.Services.DatabaseService;
using System.Security.Claims;
using MistoxWebsite.Server.Entities;
using Microsoft.AspNetCore.Mvc;
namespace MistoxWebsite.Server.Controllers {
[ApiController]
public class PageLoad : ControllerBase {
DatabaseService _databaseService;
public PageLoad( DatabaseService context ) {
_databaseService = context;
}
[Route( "api/pageload" )]
[HttpPost]
public async Task<ActionResult<PageLoadObject>> onPageLoad() {
try {
if( User.Identity != null && User.Identity.IsAuthenticated ) {
string? id = User.FindFirstValue( "ID" );
if( !string.IsNullOrEmpty( id ) ) {
PageLoadObject test = await _databaseService.getPageLoadObject(int.Parse(id));
if (test.user != null){
test.Cart = await _databaseService.GetCart( test.user );
if( test != null ) {
return test;
}
}
}
}
return NotFound();
} catch (Exception e) {
Console.WriteLine(e.ToString());
return NotFound();
}
}
}
}