Skip to content

Commit

Permalink
formatting the code
Browse files Browse the repository at this point in the history
  • Loading branch information
smilkuri committed Dec 30, 2024
1 parent 70d3946 commit c793457
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions packages/frontend/src/content/CreateNote.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, FormEvent, useTransition } from "react";;
import React, { useState, FormEvent, useTransition } from "react";
import { Form, Button, Alert } from "react-bootstrap";
import { navigate, RouteComponentProps } from "@reach/router";
import { GATEWAY_URL } from "../config";
Expand Down Expand Up @@ -26,20 +26,20 @@ const CreateNote = (props: RouteComponentProps) => {
setErrorMsg(`File can't be bigger than ${MAX_FILE_SIZE / 1000000} MB`);
return;
}
startTransition(async() => {
const createNoteURL = `${GATEWAY_URL}notes`;
startTransition(async () => {
const createNoteURL = `${GATEWAY_URL}notes`;

try {
// @ts-ignore Argument of type 'undefined' is not assignable to parameter of type 'File'
const attachment = file ? await putObject(file) : undefined;
await fetch(createNoteURL, {
method: "POST",
body: JSON.stringify({ attachment, content: noteContent }),
});
navigate("/");
} catch (error) {
setErrorMsg(`${error.toString()} - ${createNoteURL} - ${noteContent}`);
}
try {
// @ts-ignore Argument of type 'undefined' is not assignable to parameter of type 'File'
const attachment = file ? await putObject(file) : undefined;
await fetch(createNoteURL, {
method: "POST",
body: JSON.stringify({ attachment, content: noteContent }),
});
navigate("/");
} catch (error) {
setErrorMsg(`${error.toString()} - ${createNoteURL} - ${noteContent}`);
}
});
};

Expand Down

0 comments on commit c793457

Please sign in to comment.