diff --git a/package-lock.json b/package-lock.json index fdc44aa..1930f2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ronas-it/rtkq-entity-api", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ronas-it/rtkq-entity-api", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.2", "license": "MIT", "dependencies": { "@reduxjs/toolkit": "^2.9.0", diff --git a/package.json b/package.json index 5ced969..b880df7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ronas-it/rtkq-entity-api", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.2", "description": "Wrapper utilities for CRUD operations with REST APIs entities using RTK Query", "license": "MIT", "author": "Ronas IT", diff --git a/src/create-entity-api.ts b/src/create-entity-api.ts index 49c5ab2..673c613 100644 --- a/src/create-entity-api.ts +++ b/src/create-entity-api.ts @@ -37,7 +37,6 @@ import { * @param {((pagination: Pagination, request: TSearchRequest) => number) | undefined} [options.getCurrentPage=((pagination) => pagination.currentPage)] - The function to get current page. * @returns {Omit, keyof EntityApiCustomHooks> & EntityApiCustomHooks} The entity API. */ - export function createEntityApi< TEntity extends BaseEntity, TSearchRequest extends PaginationRequest = PaginationRequest, diff --git a/src/types/custom-hooks.ts b/src/types/custom-hooks.ts index 785f607..8828d45 100644 --- a/src/types/custom-hooks.ts +++ b/src/types/custom-hooks.ts @@ -6,5 +6,8 @@ export type EntityApiCustomHooks< TSearchRequest extends PaginationRequest = PaginationRequest, TSearchResponse extends PaginationResponse = PaginationResponse, > = { + /** + * @deprecated This hook will be removed. Instead, use 'useSearchPaginatedInfiniteQuery' hook in your entity API + */ useSearchInfiniteQuery: ReturnType>; }; diff --git a/src/types/entity-api-utils.ts b/src/types/entity-api-utils.ts index 102d252..fc7da8b 100644 --- a/src/types/entity-api-utils.ts +++ b/src/types/entity-api-utils.ts @@ -75,7 +75,7 @@ export type EntityApiUtils< */ handleEntityUpdate: ( arg: EntityPartial | TEntity['id'], - endpointLifecycle: LifecycleApi, EntityPartial | TEntity['id']>, + endpointLifecycle: LifecycleApi | void, EntityPartial | TEntity['id']>, options?: { optimistic?: boolean; shouldRefetchEntity?: boolean;