diff --git a/backend/Controllers/AnnouncementsController.cs b/backend/Controllers/AnnouncementsController.cs index 5658f16..5e11800 100644 --- a/backend/Controllers/AnnouncementsController.cs +++ b/backend/Controllers/AnnouncementsController.cs @@ -72,6 +72,7 @@ public class AnnouncementsController : ControllerBase } [HttpGet("{id}")] + [AllowAnonymous] public async Task> GetAnnouncement(Guid id) { var announcement = await _context.Announcements diff --git a/backend/backend.Tests/Utilities/TestDataFactory.cs b/backend/backend.Tests/Utilities/TestDataFactory.cs index b8bfdbc..605af17 100644 --- a/backend/backend.Tests/Utilities/TestDataFactory.cs +++ b/backend/backend.Tests/Utilities/TestDataFactory.cs @@ -84,7 +84,8 @@ public static class TestDataFactory public static Announcement CreateAnnouncement( Guid eventId, string title = "Test Announcement", - string content = "Test announcement content") + string content = "Test announcement content", + Guid? authorId = null) { return new Announcement { @@ -92,6 +93,7 @@ public static class TestDataFactory EventId = eventId, Title = title, Content = content, + AuthorId = authorId ?? Guid.NewGuid(), CreatedAt = DateTime.UtcNow, UpdatedAt = DateTime.UtcNow };