-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #747 from EdiWang/page-css-refact
Page css refact
- Loading branch information
Showing
20 changed files
with
139 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace Moonglade.Core; | ||
|
||
public record DeleteStyleSheetCommand(Guid Id) : IRequest; | ||
|
||
public class DeleteStyleSheetCommandHandler : IRequestHandler<DeleteStyleSheetCommand> | ||
{ | ||
private readonly IRepository<StyleSheetEntity> _repo; | ||
|
||
public DeleteStyleSheetCommandHandler(IRepository<StyleSheetEntity> repo) => _repo = repo; | ||
|
||
public async Task Handle(DeleteStyleSheetCommand request, CancellationToken cancellationToken) | ||
{ | ||
var styleSheet = await _repo.GetAsync(request.Id, cancellationToken); | ||
if (styleSheet is null) | ||
{ | ||
throw new InvalidOperationException($"StyleSheetEntity with Id '{request.Id}' not found."); | ||
} | ||
|
||
await _repo.DeleteAsync(styleSheet, cancellationToken); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace Moonglade.Core; | ||
|
||
public record GetStyleSheetQuery(Guid Id) : IRequest<StyleSheetEntity>; | ||
|
||
public class GetStyleSheetQueryHandler : IRequestHandler<GetStyleSheetQuery, StyleSheetEntity> | ||
{ | ||
private readonly IRepository<StyleSheetEntity> _repo; | ||
|
||
public GetStyleSheetQueryHandler(IRepository<StyleSheetEntity> repo) => _repo = repo; | ||
|
||
public async Task<StyleSheetEntity> Handle(GetStyleSheetQuery request, CancellationToken cancellationToken) | ||
{ | ||
var result = await _repo.GetAsync(request.Id, cancellationToken); | ||
return result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.