v3: added site-wide categories, added admin category management, various visual fixes
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 2m52s

This commit is contained in:
khannurien
2026-06-28 16:23:44 +00:00
parent c8c7b05c25
commit fae25f3e6c
44 changed files with 2144 additions and 399 deletions

View File

@@ -64,6 +64,7 @@ export interface Dump {
commentCount: number;
isPrivate: boolean;
thumbnailMime?: string;
categoryIds?: string[];
}
export type RawDump = WithStringDate<Dump>;
@@ -80,6 +81,41 @@ export function hydrateDump(raw: unknown): Dump {
return deserializeDump(raw as RawDump);
}
/**
* Categories
*/
export interface Category {
id: string;
slug: string;
name: string;
position: number;
createdAt: Date;
updatedAt?: Date;
}
export type RawCategory = WithStringDate<Category>;
export function deserializeCategory(raw: RawCategory): Category {
return {
...raw,
createdAt: new Date(raw.createdAt),
updatedAt: raw.updatedAt ? new Date(raw.updatedAt) : undefined,
};
}
export interface CreateCategoryRequest {
slug: string;
name: string;
position?: number;
}
export interface UpdateCategoryRequest {
slug?: string;
name?: string;
position?: number;
}
/**
* Users
*/
@@ -540,6 +576,7 @@ export interface CreateUrlDumpRequest {
url: string;
comment?: string;
isPrivate?: boolean;
categoryIds?: string[];
}
export interface UpdateDumpRequest {
@@ -547,6 +584,7 @@ export interface UpdateDumpRequest {
title?: string;
comment?: string;
isPrivate?: boolean;
categoryIds?: string[];
}
export interface CreateCommentRequest {