Skip to content

Commit

Permalink
chore(example): Create Object with tags
Browse files Browse the repository at this point in the history
  • Loading branch information
rrr523 committed Dec 7, 2023
1 parent 0ab36a4 commit 379d925
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/nextjs/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export const getSps = async () => {
const sps = await client.sp.getStorageProviders();
const finalSps = (sps ?? []).filter((v: any) => v.endpoint.includes('nodereal'));

// const finalSps = sps.filter((v) => v.id === 4);

return finalSps;
};

Expand Down
24 changes: 24 additions & 0 deletions examples/nextjs/src/components/object/create/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@ export const CreateObject = () => {
redundancyType: 'REDUNDANCY_EC_TYPE',
contentLength,
expectCheckSums: JSON.parse(expectCheckSums),
// empty tags
// tags: {
// tags: [],
// },
tags: {
tags: [
{
key: 'test',
value: 'test',
},
],
},
},
{
type: 'EDDSA',
Expand Down Expand Up @@ -172,6 +184,18 @@ export const CreateObject = () => {
bucketName: createObjectInfo.bucketName,
objectName: createObjectInfo.objectName + '/',
creator: address,
// empty tags
// tags: {
// tags: [],
// },
tags: {
tags: [
{
key: 'test',
value: 'test',
},
],
},
},
{
type: 'EDDSA',
Expand Down

0 comments on commit 379d925

Please sign in to comment.