Ignore:
Timestamp:
06/24/26 16:28:50 (12 days ago)
Author:
kikisrbinoska <srbinoskakristina07@…>
Branches:
main
Children:
a8f4a2d
Parents:
0b502c2
Message:

Fixed writer section and admin management

Location:
ChapterX.Application/Story/Commands
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • ChapterX.Application/Story/Commands/AddHandler.cs

    r0b502c2 r99c1e45  
    3131                {
    3232                    MatureContent = request.MatureContent,
     33                    Title = request.Title,
    3334                    ShortDescription = request.ShortDescription,
    3435                    Image = request.Image,
  • ChapterX.Application/Story/Commands/AddRequest.cs

    r0b502c2 r99c1e45  
    66    public record AddRequest(
    77        bool MatureContent,
     8        [Required][MaxLength(200)] string Title,
    89        [Required][MaxLength(500)] string ShortDescription,
    910        [MaxLength(2048)] string? Image,
  • ChapterX.Application/Story/Commands/DeleteHandler.cs

    r0b502c2 r99c1e45  
    2222                return new DeleteResponse(false);
    2323
    24             if (story.UserId != request.CallerId)
     24            if (!request.IsAdmin && story.UserId != request.CallerId)
    2525                throw new UnauthorizedAccessException("You do not own this story.");
    2626
  • ChapterX.Application/Story/Commands/DeleteRequest.cs

    r0b502c2 r99c1e45  
    33namespace ChapterX.Application.Story.Commands
    44{
    5     public record DeleteRequest(int Id, int CallerId) : IRequest<DeleteResponse>;
     5    public record DeleteRequest(int Id, int CallerId, bool IsAdmin = false) : IRequest<DeleteResponse>;
    66}
  • ChapterX.Application/Story/Commands/UpdateHandler.cs

    r0b502c2 r99c1e45  
    2626
    2727            story.MatureContent = request.MatureContent;
     28            story.Title = request.Title;
    2829            story.ShortDescription = request.ShortDescription;
    2930            story.Image = request.Image;
  • ChapterX.Application/Story/Commands/UpdateRequest.cs

    r0b502c2 r99c1e45  
    33namespace ChapterX.Application.Story.Commands
    44{
    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>;
    66}
Note: See TracChangeset for help on using the changeset viewer.