From c464f6cbaf5707c86b602d38eeeace6125b711a9 Mon Sep 17 00:00:00 2001 From: S4-K1 Date: Thu, 14 Sep 2023 16:28:20 +0100 Subject: [PATCH 1/3] RK-487-custom-org-alias --- src/modules/content.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/content.ts b/src/modules/content.ts index bdc1d7a..177a411 100644 --- a/src/modules/content.ts +++ b/src/modules/content.ts @@ -22,10 +22,13 @@ export interface IContentItem extends Entity { content: string ordering: number published: boolean + alias: string category: ICategory } -export type UpdateContentItemParams = Partial & { ordering?: ReorderCommand } +export type UpdateContentItemParams = Partial & + { ordering?: ReorderCommand } & + { alias?: string } export interface CreateContentItemParams { title: string @@ -95,6 +98,7 @@ export class ContentItem implements IContentItem, Imagable { readonly id!: string; ordering!: number; published!: boolean; + alias!: string; title!: string; readonly type!: EntityType; @timestamp() readonly updated_at!: Date; From fabe608281a3a8d037233f0986e5621e307871e3 Mon Sep 17 00:00:00 2001 From: S4-K1 Date: Fri, 15 Sep 2023 12:22:08 +0100 Subject: [PATCH 2/3] Alias added to query --- src/modules/content.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/content.ts b/src/modules/content.ts index 177a411..2a2c965 100644 --- a/src/modules/content.ts +++ b/src/modules/content.ts @@ -41,6 +41,7 @@ export type ContentSort = 'title' | 'ordering' | 'created_at' | 'updated_at' export interface ListContentsQuery extends PaginatedQuery, SortableQuery { published?: QueryBoolean title?: string + alias?: string category?: string search?: string } From 414fca7fd22f3cc3f51141ed71e0efa60a5c9bb2 Mon Sep 17 00:00:00 2001 From: S4-K1 Date: Fri, 15 Sep 2023 15:06:17 +0100 Subject: [PATCH 3/3] Alias to categories --- src/modules/categories.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/categories.ts b/src/modules/categories.ts index 8a42523..f7c3339 100644 --- a/src/modules/categories.ts +++ b/src/modules/categories.ts @@ -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; @@ -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 @@ -94,6 +96,7 @@ export class Category implements ICategory { export type CategorySortFields = 'name' | 'parent_id' export interface ListCategoriesQuery extends PaginatedQuery, SortableQuery { name?: string + alias?: string search?: string published?: QueryBoolean searchable?: QueryBoolean @@ -122,6 +125,7 @@ export interface CreateCategoryParams extends Partial { } export interface UpdateCategoryParams extends Partial { + alias?: string ordering?: 'up' | 'down' }