Almost finish implementing client side

This commit is contained in:
2025-11-06 20:22:16 +02:00
parent a847779582
commit a891a686fd
42 changed files with 6450 additions and 57 deletions

View File

@@ -1,3 +1,4 @@
using T120B165_ImgBoard.Dtos.Tag;
using File = T120B165_ImgBoard.Models.File;
namespace T120B165_ImgBoard.Dtos.Post;
@@ -7,8 +8,9 @@ public record PostDto(
string Title,
string Description,
SlimUserDto Author,
List<Models.Tag> Tags,
string? FileUrl
List<TagDto> Tags,
string? FileUrl,
DateTime CreatedAt
)
{
public static PostDto FromPost(Models.Post post, string? fileUrl)
@@ -18,8 +20,9 @@ public record PostDto(
Title: post.Title,
Description: post.Description,
Author: SlimUserDto.FromUser(post.Author),
Tags: post.Tags,
FileUrl: fileUrl
Tags: post.Tags.Select(TagDto.FromTag).ToList(),
FileUrl: fileUrl,
CreatedAt: post.Created
);
}
}