Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bilimig committed Jun 23, 2024
1 parent b7dfb07 commit 4d3881d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Server/ReasnAPI/ReasnAPI/Controllers/EventsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,12 @@ public IActionResult GetEventsParameters()
}

[HttpGet]
[Authorize(Roles = "Admin, Organizer\"")]
[Authorize(Roles = "Admin, Organizer")]
[Route("/tags")]
[ProducesResponseType<List<TagDto>>(StatusCodes.Status200OK)]
[ProducesResponseType<List<string>>(StatusCodes.Status200OK)]
public IActionResult GetEventsTags()
{

var tags = tagService.GetAllTags().ToList();
var tags = tagService.GetAllTagsNames().ToList();
return Ok(tags);
}

Expand Down
7 changes: 7 additions & 0 deletions Server/ReasnAPI/ReasnAPI/Services/TagService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ public IEnumerable<TagDto> GetAllTags()
.AsEnumerable();
}

public IEnumerable<string> GetAllTagsNames()
{
return context.Tags
.Select(t => t.Name)
.AsEnumerable();

}
public IEnumerable<TagDto> GetTagsByFilter(Expression<Func<Tag, bool>> filter)
{
return context.Tags
Expand Down

0 comments on commit 4d3881d

Please sign in to comment.