Skip to content

Commit

Permalink
Fix the error in code snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
wuhaixian1984 committed Jun 3, 2024
1 parent 161a2d7 commit e92337b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/build-file-storing-demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async function addFile(ipfs: IPFS.IPFS, fileContent: any) {
});

// 2. Add file to ipfs
const { cid } = await ipfs.add(fileContent);
const cid = await ipfs.add(fileContent);

// 3. Get file status from ipfs
const fileStat = await ipfs.files.stat("/ipfs/" + cid.path);
Expand Down Expand Up @@ -85,7 +85,7 @@ async function addFile(ipfs: IPFS.IPFS, fileContent: any) {
});

// 2. Add file to ipfs
const { cid } = await ipfs.add(fileContent);
const cid = await ipfs.add(fileContent);

// 3. Get file status from ipfs
const fileStat = await ipfs.files.stat("/ipfs/" + cid.path);
Expand Down
4 changes: 2 additions & 2 deletions website/translated_docs/zh-CN/build-file-storing-demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async function addFile(ipfs: IPFS.IPFS, fileContent: any) {
});

// 2. Add file to ipfs
const { cid } = await ipfs.add(fileContent);
const cid = await ipfs.add(fileContent);

// 3. Get file status from ipfs
const fileStat = await ipfs.files.stat("/ipfs/" + cid.path);
Expand Down Expand Up @@ -85,7 +85,7 @@ async function addFile(ipfs: IPFS.IPFS, fileContent: any) {
});

// 2. Add file to ipfs
const { cid } = await ipfs.add(fileContent);
const cid = await ipfs.add(fileContent);

// 3. Get file status from ipfs
const fileStat = await ipfs.files.stat("/ipfs/" + cid.path);
Expand Down

0 comments on commit e92337b

Please sign in to comment.