feat(ui): remove SerializableObject, use type-fest's JsonObject

This commit is contained in:
psychedelicious
2024-11-06 18:24:26 +10:00
parent b049880502
commit 5df3c00e28
25 changed files with 61 additions and 74 deletions

View File

@@ -1,6 +1,5 @@
import type { StartQueryActionCreatorOptions } from '@reduxjs/toolkit/dist/query/core/buildInitiate';
import { getStore } from 'app/store/nanostores/store';
import type { SerializableObject } from 'common/types';
import type { BoardId } from 'features/gallery/store/types';
import { ASSETS_CATEGORIES, IMAGE_CATEGORIES } from 'features/gallery/store/types';
import type { components, paths } from 'services/api/schema';
@@ -76,7 +75,7 @@ export const imagesApi = api.injectEndpoints({
query: (image_name) => ({ url: buildImagesUrl(`i/${image_name}`) }),
providesTags: (result, error, image_name) => [{ type: 'Image', id: image_name }],
}),
getImageMetadata: build.query<SerializableObject | undefined, string>({
getImageMetadata: build.query<JsonObject | undefined, string>({
query: (image_name) => ({ url: buildImagesUrl(`i/${image_name}/metadata`) }),
providesTags: (result, error, image_name) => [{ type: 'ImageMetadata', id: image_name }],
}),
@@ -270,7 +269,7 @@ export const imagesApi = api.injectEndpoints({
session_id?: string;
board_id?: string;
crop_visible?: boolean;
metadata?: SerializableObject;
metadata?: JsonObject;
isFirstUploadOfBatch?: boolean;
}
>({
@@ -613,7 +612,7 @@ export const getImageDTO = (image_name: string, options?: StartQueryActionCreato
export const getImageMetadata = (
image_name: string,
options?: StartQueryActionCreatorOptions
): Promise<SerializableObject | undefined> => {
): Promise<JsonObject | undefined> => {
const _options = {
subscribe: false,
...options,