Skip to content
Draft
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
4 changes: 4 additions & 0 deletions src/modules/categories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type { FieldData } from "./fields";
export interface ICategory extends Entity, TreeNode, Fields {
type: EntityType;
name: string;
alias: string | null;
parent_id: string | null;

published: boolean;
Expand Down Expand Up @@ -74,6 +75,7 @@ export class Category implements ICategory {
@timestamp() readonly created_at!: Date
readonly id!: string
name!: string
alias!: string | null
parent_id!: string | null
type!: EntityType
@timestamp() readonly updated_at!: Date
Expand All @@ -94,6 +96,7 @@ export class Category implements ICategory {
export type CategorySortFields = 'name' | 'parent_id'
export interface ListCategoriesQuery extends PaginatedQuery, SortableQuery<CategorySortFields> {
name?: string
alias?: string
search?: string
published?: QueryBoolean
searchable?: QueryBoolean
Expand Down Expand Up @@ -122,6 +125,7 @@ export interface CreateCategoryParams extends Partial<Fields> {
}

export interface UpdateCategoryParams extends Partial<CreateCategoryParams> {
alias?: string
ordering?: 'up' | 'down'
}

Expand Down
7 changes: 6 additions & 1 deletion src/modules/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ export interface IContentItem extends Entity {
content: string
ordering: number
published: boolean
alias: string
category: ICategory
}

export type UpdateContentItemParams = Partial<CreateContentItemParams> & { ordering?: ReorderCommand }
export type UpdateContentItemParams = Partial<CreateContentItemParams> &
{ ordering?: ReorderCommand } &
{ alias?: string }

export interface CreateContentItemParams {
title: string
Expand All @@ -38,6 +41,7 @@ export type ContentSort = 'title' | 'ordering' | 'created_at' | 'updated_at'
export interface ListContentsQuery extends PaginatedQuery, SortableQuery<ContentSort> {
published?: QueryBoolean
title?: string
alias?: string
category?: string
search?: string
}
Expand Down Expand Up @@ -95,6 +99,7 @@ export class ContentItem implements IContentItem, Imagable<ContentItem> {
readonly id!: string;
ordering!: number;
published!: boolean;
alias!: string;
title!: string;
readonly type!: EntityType;
@timestamp() readonly updated_at!: Date;
Expand Down