Skip to content

Commit

Permalink
Merge pull request #1020 from ita-social-projects/master
Browse files Browse the repository at this point in the history
merge master to deve;op
  • Loading branch information
BohdanBybliv authored Jan 7, 2024
2 parents 65ed037 + 8490f60 commit 1b2ca89
Show file tree
Hide file tree
Showing 7 changed files with 1,652 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AutoMapper;
using AutoMapper;
using FluentResults;
using MediatR;
using Microsoft.Extensions.Localization;
using Streetcode.BLL.DTO.Streetcode;
using Streetcode.BLL.Interfaces.Logging;
using Streetcode.BLL.MediatR.Streetcode.Streetcode.GetAllShort;
using Streetcode.BLL.SharedResource;
using Streetcode.DAL.Entities.Streetcode;
using Streetcode.DAL.Enums;
using Streetcode.DAL.Repositories.Interfaces.Base;

namespace Streetcode.BLL.MediatR.Streetcode.Streetcode.GetCount
Expand All @@ -31,7 +26,17 @@ public GetStreetcodesCountHander(IRepositoryWrapper repositoryWrapper, IMapper m

public async Task<Result<int>> Handle(GetStreetcodesCountQuery request, CancellationToken cancellationToken)
{
var streetcodes = await _repositoryWrapper.StreetcodeRepository.GetAllAsync();
IEnumerable<StreetcodeContent> streetcodes;

if (request.onlyPublished)
{
streetcodes = await _repositoryWrapper.StreetcodeRepository
.GetAllAsync(s => s.Status == StreetcodeStatus.Published);
}
else
{
streetcodes = await _repositoryWrapper.StreetcodeRepository.GetAllAsync();
}

if (streetcodes != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

namespace Streetcode.BLL.MediatR.Streetcode.Streetcode.GetCount
{
public record GetStreetcodesCountQuery : IRequest<Result<int>>;
public record GetStreetcodesCountQuery(bool onlyPublished) : IRequest<Result<int>>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class StreetcodeContent
public string? Teaser { get; set; }

[Required]
[MaxLength(50)]
[MaxLength(100)]
public string? DateString { get; set; }

[MaxLength(50)]
Expand Down
Loading

0 comments on commit 1b2ca89

Please sign in to comment.