Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BitBuilder] Add "Close form" button #123

Closed
wants to merge 1 commit into from

Conversation

ellipsis-dev[bot]
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot commented Nov 2, 2023

Summary:

Issue: #122
Plan feedback: Approved by @hbrooks

Open in Gitpod

Implementation:

  1. Add a new button to the FormDetailPage
    • In the /src/pages/forms/[id].tsx file, add a new button to the left of the existing 'View live form' button. The button should have a white background with red text. The text on the button should say 'Close form' when is_open = true, and 'Open form' when is_open = false.
  2. Add onClick event to the button
    • In the /src/pages/forms/[id].tsx file, add an onClick event to the new button. When clicked, the button should flip the boolean for the is_open column in the correct row in the database. Use the supabase client for this. The code for updating the database should look like this:
const { error } = await supabase
  .from('forms')
  .update({ is_open: !form.is_open })
  .eq('id', form.id)

This code will update the is_open field of the form with the opposite of its current value.

Report:

Step Result Details
1
Add a new button to the FormDetailPageAdded a new button to the FormDetailPage
2
Add onClick event to the buttonAdded onClick event to the 'Close form'/'Open form' button

Something look wrong?: If this Pull Request doesn't contain the expected changes, add more information to #122. Then, add the bitbuilder:create label to try again. For more information, check the documentation.

Generated with ❤️ by www.bitbuilder.ai

@ellipsis-dev ellipsis-dev bot requested a review from hbrooks November 2, 2023 21:26
Copy link

vercel bot commented Nov 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
talk-form-ai ✅ Ready (Inspect) Visit Preview Nov 2, 2023 9:26pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant