Changeset 99c1e45 for ChapterX.Application/Story/Commands
- Timestamp:
- 06/24/26 16:28:50 (12 days ago)
- Branches:
- main
- Children:
- a8f4a2d
- Parents:
- 0b502c2
- Location:
- ChapterX.Application/Story/Commands
- Files:
-
- 6 edited
-
AddHandler.cs (modified) (1 diff)
-
AddRequest.cs (modified) (1 diff)
-
DeleteHandler.cs (modified) (1 diff)
-
DeleteRequest.cs (modified) (1 diff)
-
UpdateHandler.cs (modified) (1 diff)
-
UpdateRequest.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ChapterX.Application/Story/Commands/AddHandler.cs
r0b502c2 r99c1e45 31 31 { 32 32 MatureContent = request.MatureContent, 33 Title = request.Title, 33 34 ShortDescription = request.ShortDescription, 34 35 Image = request.Image, -
ChapterX.Application/Story/Commands/AddRequest.cs
r0b502c2 r99c1e45 6 6 public record AddRequest( 7 7 bool MatureContent, 8 [Required][MaxLength(200)] string Title, 8 9 [Required][MaxLength(500)] string ShortDescription, 9 10 [MaxLength(2048)] string? Image, -
ChapterX.Application/Story/Commands/DeleteHandler.cs
r0b502c2 r99c1e45 22 22 return new DeleteResponse(false); 23 23 24 if ( story.UserId != request.CallerId)24 if (!request.IsAdmin && story.UserId != request.CallerId) 25 25 throw new UnauthorizedAccessException("You do not own this story."); 26 26 -
ChapterX.Application/Story/Commands/DeleteRequest.cs
r0b502c2 r99c1e45 3 3 namespace ChapterX.Application.Story.Commands 4 4 { 5 public record DeleteRequest(int Id, int CallerId ) : IRequest<DeleteResponse>;5 public record DeleteRequest(int Id, int CallerId, bool IsAdmin = false) : IRequest<DeleteResponse>; 6 6 } -
ChapterX.Application/Story/Commands/UpdateHandler.cs
r0b502c2 r99c1e45 26 26 27 27 story.MatureContent = request.MatureContent; 28 story.Title = request.Title; 28 29 story.ShortDescription = request.ShortDescription; 29 30 story.Image = request.Image; -
ChapterX.Application/Story/Commands/UpdateRequest.cs
r0b502c2 r99c1e45 3 3 namespace ChapterX.Application.Story.Commands 4 4 { 5 public record UpdateRequest(int Id, bool MatureContent, string ShortDescription, string? Image, string Content, int CallerId = 0) : IRequest<UpdateResponse>;5 public record UpdateRequest(int Id, bool MatureContent, string Title, string ShortDescription, string? Image, string Content, int CallerId = 0) : IRequest<UpdateResponse>; 6 6 }
Note:
See TracChangeset
for help on using the changeset viewer.
