This commit is contained in:
Tizian.Breuch
2025-08-01 15:11:42 +02:00
parent 96f082b38f
commit 55eeaca7f4
29 changed files with 452 additions and 452 deletions

View File

@@ -1,9 +1,9 @@
// src/Webshop.Api/Controllers/Public/categorysController.cs
// src/Webshop.Api/Controllers/Public/categoriesController.cs
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;
using Webshop.Application.DTOs.Categorys;
using Webshop.Application.DTOs.categories;
using Webshop.Application.Services.Public;
namespace Webshop.Api.Controllers.Public
@@ -11,28 +11,28 @@ namespace Webshop.Api.Controllers.Public
[ApiController]
[Route("api/v1/public/[controller]")]
[AllowAnonymous]
public class CategoryController : ControllerBase
public class categorieController : ControllerBase
{
private readonly ICategoryService _categoryService;
private readonly ICategorieService _categorieservice;
public CategoryController(ICategoryService categoryService)
public categorieController(ICategorieService categorieservice)
{
_categoryService = categoryService;
_categorieservice = categorieservice;
}
[HttpGet]
public async Task<ActionResult<IEnumerable<CategoryDto>>> GetActivecategorys()
public async Task<ActionResult<IEnumerable<categorieDto>>> GetActivecategories()
{
var categorys = await _categoryService.GetAllActiveAsync();
return Ok(categorys);
var categories = await _categorieservice.GetAllActiveAsync();
return Ok(categories);
}
[HttpGet("{slug}")]
public async Task<ActionResult<CategoryDto>> GetCategoryBySlug(string slug)
public async Task<ActionResult<categorieDto>> GetcategorieBySlug(string slug)
{
var category = await _categoryService.GetBySlugAsync(slug);
if (category == null) return NotFound();
return Ok(category);
var categorie = await _categorieservice.GetBySlugAsync(slug);
if (categorie == null) return NotFound();
return Ok(categorie);
}
}
}