From 9de4121037fa5bd65626997fd0cc514fbbee8776 Mon Sep 17 00:00:00 2001 From: Noam Honig Date: Thu, 18 Apr 2024 13:51:53 +0300 Subject: [PATCH] update --- misc/public-api.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/misc/public-api.md b/misc/public-api.md index 5621e551a..17e4e3b37 100644 --- a/misc/public-api.md +++ b/misc/public-api.md @@ -39,15 +39,22 @@ export interface ApiClient { * * @example * // Adding bearer token authorization - * remult.apiClient.httpClient = (input: RequestInfo | URL, init?: RequestInit) => { + * remult.apiClient.httpClient = ( + * input: RequestInfo | URL, + * init?: RequestInit + * ) => { * return fetch(input, { * ...init, - * headers: { - * authorization: 'Bearer ' + sessionStorage.sessionId, - * }, + * headers: authToken + * ? { + * ...init?.headers, + * authorization: 'Bearer ' + authToken, + * } + * : init?.headers, + * * cache: 'no-store', - * }); - * }; + * }) + * } */ httpClient?: ExternalHttpProvider | typeof fetch /** @@ -1873,7 +1880,7 @@ export declare class Remult { * @param entity - the entity to use * @param dataProvider - an optional alternative data provider to use. Useful for writing to offline storage or an alternative data provider */ - repo(entity: ClassType, dataProvider?: DataProvider): Repository + repo: (entity: ClassType, dataProvider?: DataProvider) => Repository /** Returns the current user's info */ user?: UserInfo /** Checks if a user was authenticated */