edits to documentation for api

This commit is contained in:
Martina 2021-05-26 19:33:19 -07:00
parent 81b08a85a8
commit 0bc77d6419
4 changed files with 6 additions and 26 deletions

View File

@ -22,14 +22,9 @@ if (!response) {
return; return;
} }
if (!response.ok) {
console.log(response.error);
return response.error;
}
const json = await response.json(); const json = await response.json();
if (json.error) { if (json.error) {
console.log(json.error); console.log(json);
} else { } else {
const collection = json.slate; const collection = json.slate;
}`; }`;

View File

@ -22,14 +22,9 @@ if (!response) {
return; return;
} }
if (!response.ok) {
console.log(response.error);
return response.error;
}
const json = await response.json(); const json = await response.json();
if (json.error) { if (json.error) {
console.log(json.error); console.log(json);
} else { } else {
const collection = json.collection; const collection = json.collection;
}`; }`;

View File

@ -22,14 +22,9 @@ if (!response) {
return; return;
} }
if (!response.ok) {
console.log(response.error);
return response.error;
}
const json = await response.json(); const json = await response.json();
if (json.error) { if (json.error) {
console.log(json.error); console.log(json);
} else { } else {
const user = json.user; const user = json.user;
}`; }`;

View File

@ -16,14 +16,9 @@ if (!response) {
return; return;
} }
if (!response.ok) {
console.log(response.error);
return response.error;
}
const json = await response.json(); const json = await response.json();
if (json.error) { if (json.error) {
console.log(json.error); console.log(json);
} else { } else {
const collections = json.collections; const collections = json.collections;
const user = json.user; const user = json.user;
@ -53,7 +48,7 @@ const EXAMPLE_RESPONSE = `
objects: [ objects: [
{ {
id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
cid: "bafkreibrpxcv37juaq67it2gu7xyjo5fzq7v3r55ykcgzylvsfljcv3s3a", // the file URL is "https://slate.textile.io/ipfs/file-cid" cid: "bafkreibrpxcv37juaq67it2gu7xyjo5fzq7v3r55ykcgzylvsfljcv3s3a", // the file URL is "https://slate.textile.io/ipfs/bafkreibrpxcv37juaq67it2gu7xyjo5fzq7v3r55ykcgzylvsfljcv3s3a"
filename: "door.jpg", filename: "door.jpg",
ownerId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", ownerId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
data: { data: {
@ -92,7 +87,7 @@ const EXAMPLE_RESPONSE = `
library: [ library: [
{ {
id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
cid: "bafkreibrpxcv37juaq67it2gu7xyjo5fzq7v3r55ykcgzylvsfljcv3s3a", // the file URL is "https://slate.textile.io/ipfs/file-cid" cid: "bafkreibrpxcv37juaq67it2gu7xyjo5fzq7v3r55ykcgzylvsfljcv3s3a", // the file URL is "https://slate.textile.io/ipfs/bafkreibrpxcv37juaq67it2gu7xyjo5fzq7v3r55ykcgzylvsfljcv3s3a"
filename: "door.jpg", filename: "door.jpg",
ownerId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", ownerId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
data: { data: {