mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
fix retrieveDDO and storeDDO
This commit is contained in:
parent
3cd9306928
commit
7a79bd3883
@ -96,11 +96,14 @@ export default class Aquarius {
|
|||||||
.post(fullUrl, DDO.serialize(ddo))
|
.post(fullUrl, DDO.serialize(ddo))
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
return new DDO(response.json() as DDO)
|
return response.json()
|
||||||
}
|
}
|
||||||
Logger.error("storeDDO failed:", response.status, response.statusText)
|
Logger.error("storeDDO failed:", response.status, response.statusText)
|
||||||
return null as DDO
|
return null as DDO
|
||||||
})
|
})
|
||||||
|
.then((response: DDO) => {
|
||||||
|
return new DDO(response) as DDO
|
||||||
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
Logger.error("Error fetching querying metadata: ", error)
|
Logger.error("Error fetching querying metadata: ", error)
|
||||||
return null as DDO
|
return null as DDO
|
||||||
@ -115,11 +118,14 @@ export default class Aquarius {
|
|||||||
.get(fullUrl)
|
.get(fullUrl)
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
return new DDO(response.json() as DDO)
|
return response.json()
|
||||||
}
|
}
|
||||||
Logger.log("retrieveDDO failed:", response.status, response.statusText)
|
Logger.log("retrieveDDO failed:", response.status, response.statusText)
|
||||||
return null as DDO
|
return null as DDO
|
||||||
})
|
})
|
||||||
|
.then((response: DDO) => {
|
||||||
|
return new DDO(response) as DDO
|
||||||
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
Logger.error("Error fetching querying metadata: ", error)
|
Logger.error("Error fetching querying metadata: ", error)
|
||||||
return null as DDO
|
return null as DDO
|
||||||
|
Loading…
Reference in New Issue
Block a user