config-upload-poc/Controllers/SettingsController.cs
2024-12-18 11:41:17 +05:30

30 lines
690 B
C#

using Aquila_1.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
[Authorize(Policy = "AdminOnly")]
public class SettingsController : Controller
{
public IActionResult Index()
{
var settings = new SettingsViewModel
{
Setting1 = "Default Value",
Setting2 = false,
Setting3 = "Default Value"
};
return View(settings);
}
[HttpPost]
public IActionResult Index(SettingsViewModel model)
{
if (ModelState.IsValid)
{
// Save settings logic here
return RedirectToAction("Index", "Home");
}
return View(model);
}
}