mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
update retrieveShaclSchema
This commit is contained in:
parent
009da7b051
commit
e83ec6e5f8
@ -140,16 +140,23 @@ export async function retrieveAsset(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let schema: any
|
||||||
|
export function retrieveShaclSchema(): Promise<ShaclSchema> {
|
||||||
|
console.log(schema)
|
||||||
|
if (schema) return schema
|
||||||
|
|
||||||
export async function retrieveShaclSchema(): Promise<ShaclSchema> {
|
|
||||||
try {
|
try {
|
||||||
const response: AxiosResponse<ShaclSchema> = await axios.get(
|
const getSchema = axios.get(
|
||||||
`${metadataCacheUri}/api/aquarius/validation/schema`
|
`${metadataCacheUri}/api/aquarius/validation/schema`
|
||||||
)
|
)
|
||||||
if (!response || response.status !== 200 || !response.data) return
|
|
||||||
|
|
||||||
const data = { ...response.data }
|
return getSchema.then((res: any) => {
|
||||||
return data
|
if (!res || res.status !== 200 || !res.data) return
|
||||||
|
|
||||||
|
const data = { ...res.data }
|
||||||
|
schema = data
|
||||||
|
return data
|
||||||
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (axios.isCancel(error)) {
|
if (axios.isCancel(error)) {
|
||||||
LoggerInstance.log(error.message)
|
LoggerInstance.log(error.message)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user