From 7bb013346f78cde66957e798f22e26c12de6a7ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Beregsz=C3=A1szi?= Date: Wed, 13 Mar 2024 19:19:40 +0100 Subject: [PATCH 1/3] [DEV-12629] Add `is_featured`, `image` to Category --- src/endpoints/NewsroomCategories/types.ts | 7 ++++++- src/types/Category.ts | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/endpoints/NewsroomCategories/types.ts b/src/endpoints/NewsroomCategories/types.ts index c8bb6e4a..6111dda7 100644 --- a/src/endpoints/NewsroomCategories/types.ts +++ b/src/endpoints/NewsroomCategories/types.ts @@ -1,4 +1,5 @@ import type { SortOrder } from '../../types'; +import type { UploadedImage } from '@prezly/uploads'; export interface ListOptions { /** @@ -18,10 +19,12 @@ export interface CreateRequest { description?: string; }; }; + image?: UploadedImage | null; + is_featured?: boolean; } export interface UpdateRequest { - i18n: { + i18n?: { /** * Pass `null` to erase category translation. */ @@ -30,4 +33,6 @@ export interface UpdateRequest { description?: string; }; }; + image?: UploadedImage | null; + is_featured?: boolean; } diff --git a/src/types/Category.ts b/src/types/Category.ts index 6d0f7d99..687addec 100644 --- a/src/types/Category.ts +++ b/src/types/Category.ts @@ -1,4 +1,5 @@ import type { Culture, CultureRef } from './Culture'; +import type { UploadedImage } from '@prezly/uploads'; export interface CategoryRef { id: number; @@ -24,6 +25,8 @@ export interface Category extends Omit { i18n: { [localeCode: Culture.Code]: Category.Translation; // Extension over `CategoryRef.Translation` }; + image: UploadedImage | null; + is_featured: boolean; } export namespace Category { From 10cd3653c782775cec38a0eaeb7ea9df51457a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Beregsz=C3=A1szi?= Date: Wed, 13 Mar 2024 19:22:56 +0100 Subject: [PATCH 2/3] [DEV-12629] Lint --- src/endpoints/NewsroomCategories/types.ts | 1 + src/types/Category.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/endpoints/NewsroomCategories/types.ts b/src/endpoints/NewsroomCategories/types.ts index 6111dda7..65886d40 100644 --- a/src/endpoints/NewsroomCategories/types.ts +++ b/src/endpoints/NewsroomCategories/types.ts @@ -1,4 +1,5 @@ import type { SortOrder } from '../../types'; + import type { UploadedImage } from '@prezly/uploads'; export interface ListOptions { diff --git a/src/types/Category.ts b/src/types/Category.ts index 687addec..b89fb6ff 100644 --- a/src/types/Category.ts +++ b/src/types/Category.ts @@ -1,4 +1,5 @@ import type { Culture, CultureRef } from './Culture'; + import type { UploadedImage } from '@prezly/uploads'; export interface CategoryRef { From 81be6ed1a7e34b1d9d0ad8dbc2640b8d3b5ad6d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Beregsz=C3=A1szi?= Date: Wed, 13 Mar 2024 19:24:36 +0100 Subject: [PATCH 3/3] [DEV-12629] Lint --- src/endpoints/NewsroomCategories/types.ts | 4 ++-- src/types/Category.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/endpoints/NewsroomCategories/types.ts b/src/endpoints/NewsroomCategories/types.ts index 65886d40..bbc554e6 100644 --- a/src/endpoints/NewsroomCategories/types.ts +++ b/src/endpoints/NewsroomCategories/types.ts @@ -1,7 +1,7 @@ -import type { SortOrder } from '../../types'; - import type { UploadedImage } from '@prezly/uploads'; +import type { SortOrder } from '../../types'; + export interface ListOptions { /** * Supported sort columns: diff --git a/src/types/Category.ts b/src/types/Category.ts index b89fb6ff..bbfee4ba 100644 --- a/src/types/Category.ts +++ b/src/types/Category.ts @@ -1,7 +1,7 @@ -import type { Culture, CultureRef } from './Culture'; - import type { UploadedImage } from '@prezly/uploads'; +import type { Culture, CultureRef } from './Culture'; + export interface CategoryRef { id: number; display_name: string;