diff --git a/src/Bones.UI/core/serviceFactory.ts b/src/Bones.UI/core/serviceFactory.ts index d963eec..8741210 100644 --- a/src/Bones.UI/core/serviceFactory.ts +++ b/src/Bones.UI/core/serviceFactory.ts @@ -65,10 +65,12 @@ export class ServiceFactory { return { get }; } - addFetch(url: string): { fetch: () => Promise } { - + addFetch(url: string | (() => string)): { fetch: () => Promise } { + const fetch = async () => { - const response = await ServiceFactory.http.get(url); + const realUrl = typeof url === "string" ? url : url(); + + const response = await ServiceFactory.http.get(realUrl); const dto: TDetailsDTO = response.data; const result = new this.EntityDetails(dto);