Skip to content

Commit

Permalink
Merge pull request #5 from puzzle-it-nu/master
Browse files Browse the repository at this point in the history
fix: return more file properties for use in saving
  • Loading branch information
NyllRE authored May 28, 2024
2 parents 79e0abf + ea192b6 commit f32a853
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions playground/server/api/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ export default defineEventHandler(async (event) => {
interface File {
name: string
content: string
size: string
type: string
lastModified: string
}
5 changes: 5 additions & 0 deletions src/runtime/composables/useFileStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export default function () {
reader.onload = (e: any) => {
files.value.push({
...file,
name: file.name,
size: file.size,
type: file.type,
lastModified: file.lastModified,
content: e.target.result,
})
}
Expand All @@ -31,4 +35,5 @@ export default function () {
interface File extends Blob {
content: any
name: string
lastModified: string
}

0 comments on commit f32a853

Please sign in to comment.