Skip to content

Commit c34119b

Browse files
authored
logs: log out the entire formData (#1555)
1 parent d75d595 commit c34119b

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/store/main.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,21 +2392,19 @@ export class MainStore {
23922392
const info = uiStore.meInfo;
23932393

23942394
// Inspect FormData
2395-
for (const [key, value] of body.entries()) {
2395+
const entries = Array.from(body.entries());
2396+
for (const [key, value] of entries) {
23962397
console.log(`${key}:`, value);
23972398
if (value instanceof File) {
23982399
console.log(`File name: ${value.name}, Size: ${value.size}, Type: ${value.type}`);
2399-
2400-
// Read file content
24012400
const reader = new FileReader();
24022401
reader.onload = () => {
24032402
console.log(`File content:`, reader.result);
24042403
};
24052404
reader.onerror = () => {
24062405
console.log(`Error reading file:`, reader.error);
24072406
};
2408-
// Read as text, data URL, or other format depending on file type
2409-
reader.readAsText(value); // or readAsDataURL for images, etc.
2407+
reader.readAsText(value);
24102408
}
24112409
}
24122410

0 commit comments

Comments
 (0)