Beautiful Open-Source Form Builder
Refactor OAuth callback component and enhance form update documentation
Julien Nahum1fb4d279f3ab
diff --git a/client/pages/oauth/[provider]/callback.vue b/client/pages/oauth/[provider]/callback.vueindex 28da4ae4c..b8c1b50ac 100644--- a/client/pages/oauth/[provider]/callback.vue+++ b/client/pages/oauth/[provider]/callback.vue@@ -27,11 +27,9 @@</template><script setup>-import { useNuxtApp } from "nuxt/app"import { WindowMessageTypes } from "~/composables/useWindowMessage"import { authApi } from "~/api"-const { $utm } = useNuxtApp()const router = useRouter()const route = useRoute()const loading = ref(true)diff --git a/docs/api-reference/forms/update-form.mdx b/docs/api-reference/forms/update-form.mdxindex 47e87efdb..ac46911b5 100644--- a/docs/api-reference/forms/update-form.mdx+++ b/docs/api-reference/forms/update-form.mdx@@ -25,40 +25,53 @@ Authorization: Bearer <token>| --------- | ------ | ------------------------------ || id | number | Numeric ID of the form to edit |-### Body Parameters (partial)--All fields from the [Create Form](./create-form) endpoint may be supplied. However, **certain fields are required** for form updates to succeed:--| Field | Type | Required | Description |-| ---------------------- | ------- | -------- | -------------------------------------------------------------------- |-| title | string | Yes | Form title (max 60 characters) |-| visibility | string | Yes | Form visibility state (`"public"`, `"closed"`, `"draft"`) |-| language | string | Yes | Two-letter ISO language code (e.g. `en`) |-| theme | string | Yes | Form theme |-| presentation_style | string | Yes | How the form is presented |-| width | string | Yes | Form container width |-| size | string | Yes | Form text size |-| border_radius | string | Yes | Form border radius |-| dark_mode | string | Yes | Dark mode setting |-| color | string | Yes | Primary color (hex format) |-| uppercase_labels | boolean | Yes | Whether labels should be uppercase |-| no_branding | boolean | Yes | Hide OpenForm branding |-| transparent_background | boolean | Yes | Use transparent background |-| properties | array | Yes | Array of form fields/blocks (can be empty `[]` but must be included) |-| …other fields | mixed | No | All other fields from Create Form (description, logo_picture, etc.) |+### Body Parameters++All fields from the [Create Form](./create-form) endpoint may be supplied. However, **the API validation requires you to include specific fields** in every update request, even if you only want to change one optional field.++#### Required Fields in Updates++These fields must always be included:++| Field | Type | Description |+| ---------------------- | ------- | -------------------------------------------------------------------- |+| title | string | Form title (max 60 characters) |+| visibility | string | Form visibility state (`"public"`, `"closed"`, `"draft"`) |+| language | string | Two-letter ISO language code (e.g. `en`) |+| theme | string | Form theme |+| presentation_style | string | How the form is presented |+| width | string | Form container width |+| size | string | Form text size |+| border_radius | string | Form border radius |+| dark_mode | string | Dark mode setting |+| color | string | Primary color (hex format) |+| uppercase_labels | boolean | Whether labels should be uppercase |+| no_branding | boolean | Hide OpenForm branding |+| transparent_background | boolean | Use transparent background |+| properties | array | Array of form fields/blocks — **must never be empty**, or existing properties will be lost |+| …other fields | mixed | All other fields from Create Form (description, logo_picture, etc.) |<Warning>- Omitting any of the required fields or the `properties` array will result in- a validation error. You must always include these fields in your update- request, even if you're only changing one optional field.+**Important:** Omitting any of the required fields will result in a validation error. You must include all these fields in your update request, even if you're only changing one optional field. Additionally, the `properties` array cannot be empty — always send your complete form fields.</Warning>-Important:+### Recommended Update Pattern-- Passing a new `slug` will regenerate the form URL (self-hosted only).-- The `workspace_id` can **not** be changed via this endpoint—use `/open/forms/{id}/workspace/{workspace_id}` instead.+To safely update a form without accidentally losing properties:-Example updating only title and visibility (with required fields):+1. **Fetch** the current form state using the [Get Form](./get-form) endpoint+2. **Modify** only the fields you want to change in the fetched response+3. **Send** the complete updated form (including all required fields and properties) back to this endpoint++This ensures you retain all existing form fields and don't accidentally overwrite them with empty arrays.++<Tip>+**Best Practice Example:** If you only want to change form visibility, fetch the form first, update only the `visibility` field locally, then send the complete form back with all its properties intact.+</Tip>++### Body Example++Example request updating title and visibility (note: all required fields must be included):```json{