Přemístění + dodělání funkčnosti webu.

This commit is contained in:
Matěj Kubíček
2026-09-17 17:50:48 +02:00
parent 3a35d10227
commit f223721fbd
128 changed files with 714 additions and 172 deletions
@@ -0,0 +1,44 @@
using Microsoft.AspNetCore.Mvc;
using StuzkovakWeb.Data;
namespace StuzkovakWeb.Controllers;
public class InvitesController : Controller
{
private readonly AppDbContext _context;
public InvitesController(AppDbContext context)
{
_context = context;
}
public async Task<IActionResult> Accept(Guid id)
{
var invite = await _context.Invites.FindAsync(id);
if (invite == null)
{
return NotFound();
}
invite.IsAccepted = true;
_context.Invites.Update(invite);
await _context.SaveChangesAsync();
return RedirectToAction("Index", "Home", new { Id=id });
}
public async Task<IActionResult> Refuse(Guid id)
{
var invite = await _context.Invites.FindAsync(id);
if (invite == null)
{
return NotFound();
}
invite.IsAccepted = false;
_context.Invites.Update(invite);
await _context.SaveChangesAsync();
return RedirectToAction("Index", "Home", new { Id=id });
}
}