From ac0a5bd2c8f3869ae38280b82a2a550046515fc5 Mon Sep 17 00:00:00 2001 From: Jack Merrill <8814123+jackmerrill@users.noreply.github.com> Date: Sat, 16 Jul 2022 15:28:25 -0500 Subject: [PATCH 1/2] feat: add redirect --- packages/astro-forms/Form.astro | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/astro-forms/Form.astro b/packages/astro-forms/Form.astro index a16282e..54fba74 100644 --- a/packages/astro-forms/Form.astro +++ b/packages/astro-forms/Form.astro @@ -3,13 +3,14 @@ import { GenericTheme } from "./Themes"; import { Theme, FormSchema } from "./types"; import { flatten } from "./util"; -const { schema, action, method, classes, theme, data } = Astro.props as { +const { schema, action, method, classes, theme, data, redirect } = Astro.props as { schema: FormSchema; action: string; method: "post" | "get"; classes: string; theme: Theme; - data: Record + data: Record; + redirect: string; }; const components: Theme = { @@ -25,5 +26,8 @@ const flattenedData = flatten(data); ---
+ {redirect && ( + + )} From d040eb4f385e6f91fe5e5afbaecdf04f5768afb7 Mon Sep 17 00:00:00 2001 From: Jack Merrill <8814123+jackmerrill@users.noreply.github.com> Date: Sat, 16 Jul 2022 15:28:40 -0500 Subject: [PATCH 2/2] Update package.json --- packages/astro-forms/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro-forms/package.json b/packages/astro-forms/package.json index e000889..068843e 100644 --- a/packages/astro-forms/package.json +++ b/packages/astro-forms/package.json @@ -1,6 +1,6 @@ { "name": "astro-forms", - "version": "1.0.9", + "version": "1.0.10", "description": "Forms in Astro, made easy.", "main": "index.mjs", "homepage": "https://github.com/jackmerrill/astroforms#readme",