-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add current working directory for codecov action * rename base uri to public url for images * add hide/unhide image handler * add required constraint for object name
- Loading branch information
Showing
10 changed files
with
62 additions
and
21 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
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
24 changes: 24 additions & 0 deletions
24
src/ImageHosting.Storage.WebApi/Features/Images/Handlers/SetHidenessHandler.cs
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,24 @@ | ||
using ImageHosting.Storage.Domain.ValueTypes; | ||
using ImageHosting.Storage.Infrastructure.DbContexts; | ||
using ImageHosting.Storage.WebApi.Features.Images.Models; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace ImageHosting.Storage.WebApi.Features.Images.Handlers; | ||
|
||
public interface ISetHidenessHandler | ||
{ | ||
Task<ReadImage?> SetHidenessAsync(ImageId imageId, bool hidden, CancellationToken ct = default); | ||
} | ||
|
||
public class SetHidenessHandler(IImageHostingDbContext dbContext, IGetImageHandler getImageHandler) : ISetHidenessHandler | ||
{ | ||
public async Task<ReadImage?> SetHidenessAsync(ImageId imageId, bool hidden, CancellationToken ct = default) | ||
{ | ||
await dbContext.Images | ||
.Where(i => i.Id == imageId) | ||
.ExecuteUpdateAsync(calls => calls.SetProperty(i => i.Hidden, hidden), ct); | ||
|
||
var readImage = await getImageHandler.GetAsync(imageId, ct); | ||
return readImage; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,6 @@ | |
} | ||
}, | ||
"Images": { | ||
"BaseUri": "http://localhost:8080" | ||
"PublicUrl": "http://localhost:8080" | ||
} | ||
} |