Compare commits

...

6 Commits

Author SHA1 Message Date
khwezi e7a798b5e9 Merge pull request 'Added search state model' (#52) from midrandshop into master
Reviewed-on: #52
2026-05-30 19:54:57 +02:00
Khwezi Mngoma 494b806744 Added search state model
continuous-integration/drone/pr Build is passing
2026-05-30 19:54:14 +02:00
khwezi 41b6b71b31 Merge pull request 'Redacted Price resolution from GetProductAsync' (#51) from midrandshop into master
Reviewed-on: #51
2026-05-30 18:55:46 +02:00
Khwezi Mngoma 0702caa42d Redacted Price resolution from GetProductAsync
continuous-integration/drone/pr Build is passing
2026-05-30 18:55:23 +02:00
khwezi ee6beef603 Merge pull request 'Redacted Product.Price mapping on filter' (#50) from midrandshop into master
Reviewed-on: #50
2026-05-30 18:49:38 +02:00
Khwezi Mngoma 4f6dbfcd37 Redacted Product.Price mapping on filter
continuous-integration/drone/pr Build is passing
2026-05-30 18:49:15 +02:00
2 changed files with 14 additions and 5 deletions
@@ -153,9 +153,7 @@ public sealed class ProductService(IDbContextFactory<MidrandBooksDbContext> cont
{
await using var context = await contextFactory.CreateDbContextAsync(cancellationToken);
var query = context.Products
.Include(i => i.Price)
.AsQueryable();
var query = context.Products.AsQueryable();
var cultureInfo = CultureInfo.InvariantCulture;
@@ -306,8 +304,7 @@ public sealed class ProductService(IDbContextFactory<MidrandBooksDbContext> cont
{
await using var context = await contextFactory.CreateDbContextAsync(cancellationToken);
var product = await context.Products
.Include(i => i.Price)
var product = await context.Products
.AsNoTracking().FirstOrDefaultAsync(p => p.Id == productId, cancellationToken);
return product is null
+12
View File
@@ -0,0 +1,12 @@
namespace LiteCharms.Features.Models;
public class SearchState
{
public string Query { get; private set; } = string.Empty;
public event Action? OnSearchSubmitted;
public void UpdateQuery(string newQuery) => Query = newQuery;
public void SubmitSearch() => OnSearchSubmitted?.Invoke();
}