Skip to content

Commit

Permalink
Also send meta when serializing form
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismccord committed Oct 4, 2023
1 parent 105ab2c commit e94c1b0
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions assets/js/phoenix_live_view/live_uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default class LiveUploader {
entry.relative_path = file.webkitRelativePath
entry.type = file.type
entry.size = file.size
if(typeof(file.meta) === "function"){ entry.meta = file.meta() }
fileData[uploadRef].push(entry)
})
return fileData
Expand Down
3 changes: 3 additions & 0 deletions priv/static/phoenix_live_view.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions priv/static/phoenix_live_view.cjs.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions priv/static/phoenix_live_view.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions priv/static/phoenix_live_view.esm.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions priv/static/phoenix_live_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,9 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
entry.relative_path = file.webkitRelativePath;
entry.type = file.type;
entry.size = file.size;
if (typeof file.meta === "function") {
entry.meta = file.meta();
}
fileData[uploadRef].push(entry);
});
return fileData;
Expand Down
2 changes: 1 addition & 1 deletion priv/static/phoenix_live_view.min.js

Large diffs are not rendered by default.

0 comments on commit e94c1b0

Please sign in to comment.