using System.Linq; using Microsoft.AspNetCore.Mvc; namespace BankSampahApp.Controllers.ReduksiSampah { [Route("ReduksiSampah/[controller]/[action]")] public class KompostingController : Controller { private const string Jenis = "Komposting"; public IActionResult Index() { return View("~/Views/ReduksiSampah/Komposting/Index.cshtml"); } [HttpGet] public IActionResult Table([FromQuery] string? bulan) { var data = ReduksiSampahDataStore .GetItems(Jenis) .Where(item => ReduksiSampahDataStore.MatchesBulan(item, bulan)) .Select(ReduksiSampahDataStore.ToResponse); return Json(new { data }); } } }