Spaces:
Sleeping
Sleeping
feat: implement authentication and authorization features, add book and user management controllers, and enhance UI for login and registration
b0a0ed0 | using Microsoft.AspNetCore.Mvc; | |
| using Frontend.Services; | |
| using Frontend.Models.Dtos; | |
| using Frontend.Models; | |
| using Microsoft.AspNetCore.Authorization; | |
| using System.Threading.Tasks; | |
| using System.Linq; | |
| namespace Frontend.Controllers | |
| { | |
| [] | |
| public class SubscriptionsController : Controller | |
| { | |
| private readonly LibraryApiClient _apiClient; | |
| public SubscriptionsController(LibraryApiClient apiClient) | |
| { | |
| _apiClient = apiClient; | |
| } | |
| public async Task<IActionResult> Index() | |
| { | |
| var memberships = await _apiClient.GetMembershipsAsync(); | |
| var viewModel = new SubscriptionsViewModel | |
| { | |
| AvailableMemberships = memberships?.ToList() ?? new List<MembershipDto>() | |
| }; | |
| return View(viewModel); | |
| } | |
| } | |
| } | |