diff --git a/src/common/helpers/rest-calls/index.ts b/src/common/helpers/rest-calls/index.ts index 55c1b632..9ad7c106 100644 --- a/src/common/helpers/rest-calls/index.ts +++ b/src/common/helpers/rest-calls/index.ts @@ -21,7 +21,7 @@ export const useRestCall = ({ const fullPath = useMemo(() => { let newPath = metadata.name; if (pathParameters) { - Object.keys(pathParameters).forEach((key) => { + Object.keys(pathParameters).forEach(key => { //@ts-ignore newPath = newPath.replace(':' + key, [pathParameters[key]]); }); @@ -61,7 +61,7 @@ export const useSimpleRestCall = ({ const fullPath = useMemo(() => { let newPath = metadata.name; if (pathParameters) { - Object.keys(pathParameters).forEach((key) => { + Object.keys(pathParameters).forEach(key => { //@ts-ignore newPath = newPath.replace(':' + key, [pathParameters[key]]); }); @@ -94,7 +94,7 @@ export const useMasaQuery = ( const fullPath = useMemo(() => { let newPath = metadata.name; if (pathParameters) { - Object.keys(pathParameters).forEach((key) => { + Object.keys(pathParameters).forEach(key => { //@ts-ignore newPath = newPath.replace(':' + key, [pathParameters[key]]); }); @@ -115,7 +115,7 @@ export const useMasaQuery = ( method: metadata.method, mode: 'cors', body: JSON.stringify(body), - }).then((res) => res.json()), + }).then(res => res.json()), { ...settings, enabled: !token ? false : !!settings?.enabled } ); @@ -132,7 +132,7 @@ export const useMasaMutation = ( const fullPath = useMemo(() => { let newPath = metadata.name; if (pathParameters) { - Object.keys(pathParameters).forEach((key) => { + Object.keys(pathParameters).forEach(key => { //@ts-ignore newPath = newPath.replace(':' + key, [pathParameters[key]]); }); @@ -154,7 +154,7 @@ export const useMasaMutation = ( method: metadata.method, mode: 'cors', body: JSON.stringify(newBody ? newBody : body), - }).then((res) => res.json()), + }).then(res => res.json()), { ...settings, enabled: !token ? false : !!settings?.enabled } ); diff --git a/src/common/rest/index.ts b/src/common/rest/index.ts index 404318b6..dae13881 100644 --- a/src/common/rest/index.ts +++ b/src/common/rest/index.ts @@ -12,7 +12,6 @@ import * as contractsMint from './contracts-mint'; import * as mintCreditScore from './mint-credit-score'; import * as getCreditScore from './get-credit-score'; - import * as getVezgoLink from './vezgo/get-link'; import * as listVezgoProviders from './vezgo/list-providers'; import * as listVezgoAccounts from './vezgo/list-accounts'; @@ -53,6 +52,7 @@ export interface MethodMetadata { method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS'; parameters: Parameter[]; } + export const masaRestClient = { auth, accounts,