-
-
How submission works
-
- Submitting form data is as easy as sending an HTTP request to the
- submission api, which is deployed right along this dashboard.
-
+ switch (tab) {
+ case "submit":
+ tabView = (
+
+
+
+
+ Enable submissions
+
+
+ When disabled, any submissions will be denied.
+
+
+
+
+
+
+
How submission works
+
+ Submitting form data is as easy as sending an HTTP request to the
+ submission api, which is deployed right along this dashboard.
+
-
- You send a POST
-request to{" "}
- https://{host}/api/submit
with the ID of this form as
- the `formId` URL parameter. Send any data as JSON in the request
- body. Do not forget to specify the Content-Type
{" "}
- header as application/json
.
-
-
- Here is a reference implementation of how to submit an entry for
- this form in JavaScript, where the data
argument is
- an arbitrary JSON object:
-
-
{`async function handleFormSubmission(data) {
+
+ You send a POST
-request to{" "}
+ https://{host}/api/submit
with the ID of this form as
+ the `formId` URL parameter. Send any data as JSON in the request
+ body. Do not forget to specify the Content-Type
{" "}
+ header as application/json
.
+
+
+ Here is a reference implementation of how to submit an entry for
+ this form in JavaScript, where the data
argument is
+ an arbitrary JSON object:
+
+ {`async function handleFormSubmission(data) {
const response = await fetch("https://${host}/api/forms/${forms?.[0]?.id}/submissions", {
method: "POST",
body: JSON.stringify(data),
@@ -153,247 +153,247 @@ export default function FormSettingsPage() {
throw Error(\`Submission failed with status code \${response.status}\`)
}
}`}
-
-
- );
- break;
- case "danger":
- tabView = (
-
-
-
-
- Delete this form
-
-
- Once a form is deleted, itself and all its submissions will be
- deleted. Please be certain.
-
-
-
+
+ );
+ break;
+ case "danger":
+ tabView = (
+
+
+
+
+ Delete this form
+
+
+ Once a form is deleted, itself and all its submissions will be
+ deleted. Please be certain.
+
+
+
-
-
- );
- break;
- default:
- tabView = (
-
-
-
-
- General Information
-
-
- This information is only used for this interface and is not
- exposed to the public.
-
-
-
-
-
- );
- }
+ router.push("/inbox");
+ }
+ }}
+ >
+ Delete this form
+
+