Skip to content

Commit

Permalink
add(ipos): /pinFile file size
Browse files Browse the repository at this point in the history
  • Loading branch information
hassnian committed Jul 17, 2024
1 parent 96aabae commit 45c73f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion services/ipos/src/routes/pinning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ app.post('/pinFile', vValidator('form', pinFileRequestSchema), async (c) => {
c.executionCtx.waitUntil(c.env.BUCKET.put(cid, content)),
)

const size = files.reduce((reducer, file) => reducer + file.file.size, 0)
const { cid: addedFileCid, file } = addedFiles[0]
let cid = addedFileCid
let type = file.type
Expand All @@ -104,7 +105,7 @@ app.post('/pinFile', vValidator('form', pinFileRequestSchema), async (c) => {
getPinResponse({
cid: cid.toString(),
type: type,
size: Number('0'),
size: size,
}),
)
})
Expand Down

0 comments on commit 45c73f6

Please sign in to comment.