Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-lemon committed Jan 31, 2025
1 parent 95aad9a commit c7ec1cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cores/api/api-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ export class APIService implements APIServiceClient {
const load = { method, endpoint, param, body, context };
return this.target
.doProxy(method, host, path, param, body, context, hash)
.then((data: any) => ({ index, load, data, error: null }))
.catch((error: any) => ({ index, load, data: null, error }))
.then((data: any) => ({ index, load, data, error: null as any }))
.catch((error: any) => ({ index, load, data: null as any, error }))
.then(({ index, load, data, error }) => {
const baseDir = (() => {
// eslint-disable-next-line prettier/prettier
Expand Down Expand Up @@ -402,8 +402,8 @@ export class APIService implements APIServiceClient {
throw new Error(`@method is not valid. method:${method}`);
};
return call(method)
.then((data: any) => ({ index, load, data, error: null }))
.catch((error: any) => ({ index, load, data: null, error }))
.then((data: any) => ({ index, load, data, error: null as any }))
.catch((error: any) => ({ index, load, data: null as any, error }))
.then(({ index, load, data, error }) => {
const baseDir = (() => {
// eslint-disable-next-line prettier/prettier
Expand Down
8 changes: 8 additions & 0 deletions src/extended/abstract-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,8 @@ export abstract class AbstractProxy<U extends string, T extends CoreService<Core

/**
* featch identity-acess from `lemon-accounts-api`
*
* @deprecated useless anymore since 3.2.10
*/
protected async fetchIdentityAccess(identityId: string, domain?: string) {
domain = $T.S(domain, this.context.domain);
Expand All @@ -673,6 +675,8 @@ export abstract class AbstractProxy<U extends string, T extends CoreService<Core

/**
* the cached identity model
*
* @deprecated useless anymore since 3.2.10
*/
protected _identity: { [key: string]: NextIdentityAccess } = {};

Expand All @@ -682,6 +686,8 @@ export abstract class AbstractProxy<U extends string, T extends CoreService<Core
* @param identityId id to find
* @param force (optional) force to reload if not available
* @returns the cached identity-access
*
* @deprecated useless anymore since 3.2.10
*/
public async getIdentity$(identityId: string, force?: boolean): Promise<NextIdentityAccess> {
if (!identityId) return null;
Expand All @@ -705,6 +711,8 @@ export abstract class AbstractProxy<U extends string, T extends CoreService<Core

/**
* get the current identity object (or throw access-error)
*
* @deprecated useless anymore since 3.2.10
*/
public async getCurrentIdentity$(throwable = true): Promise<NextIdentityAccess> {
const identityId = await this.getCurrentIdentityId(throwable);
Expand Down

0 comments on commit c7ec1cc

Please sign in to comment.