Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Api/Controllers/BorrowsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Application.Common.Models.Dtos;
using Application.Common.Models.Dtos.Physical;
using Application.Identity;
using Application.Loggings.Queries;
using Infrastructure.Identity.Authorization;
using Microsoft.AspNetCore.Mvc;

Expand Down
5 changes: 3 additions & 2 deletions src/Application/Entries/Commands/CreateEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ public Validator()

RuleFor(x => x.Name)
.NotEmpty().WithMessage("Entry's name is required.")
.Matches("^[\\p{L}A-Za-z_.\\s\\-0-9]*$").WithMessage("Invalid name format.")
.MaximumLength(256).WithMessage("Name cannot exceed 256 characters.");

RuleFor(x => x.Path)
.NotEmpty().WithMessage("Entry's path is required.")
.Matches("^(/(?!/)[A-Za-z_.\\s\\-0-9]*)+(?<!/)$|^/$").WithMessage("Invalid path format.");
.Matches("^(/(?!/)[\\p{L}A-Za-z_.\\s\\-0-9]*)+(?<!/)$|^/$").WithMessage("Invalid path format.");
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/Application/Entries/Commands/CreateSharedEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public Validator()
RuleLevelCascadeMode = CascadeMode.Stop;

RuleFor(x => x.Name)
.NotEmpty().WithMessage("Entry's name is required.")
.Matches("^[\\p{L}A-Za-z_.\\s\\-0-9]*$").WithMessage("Invalid name format.")
.MaximumLength(256).WithMessage("Name cannot exceed 256 characters.");
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Application/Entries/Commands/DownloadDigitalFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public async Task<Result> Handle(Command request, CancellationToken cancellation
{
Content = content,
FileType = fileType,
FileName = entry.Name,
FileName = $"{entry.Name}.{entry.File.FileExtension}",
};
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Application/Entries/Queries/GetAllEntriesPaginated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public Validator()

RuleFor(x => x.EntryPath)
.NotEmpty().WithMessage("File's path is required.")
.Matches("^(/(?!/)[A-Za-z_.\\s\\-0-9]*)+(?<!/)$|^/$").WithMessage("Invalid path format.");
.Matches("^(/(?!/)[\\p{L}A-Za-z_.\\s\\-0-9]*)+(?<!/)$|^/$").WithMessage("Invalid path format.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
using Application.Common.Models.Dtos;
using Application.Users.Queries;
using AutoMapper;
using Domain.Enums;
using MediatR;
using Microsoft.EntityFrameworkCore;

namespace Application.Borrows.Queries;
namespace Application.Loggings.Queries;

public class GetAllRequestLogsPaginated
{
Expand Down