How to Redesign a Complex Form Submission Process?

0
9
Asked By CreativeCactus42 On

I recently started working at a company that has a unique approach to backend development. We're building a web application where users can read, create, update, and delete records. The challenge I'm facing is that they have a "page of truth" setup, where one page has many fields to update, and when submitted, it triggers multiple backend actions. Designers create this "page of truth" and then developers have to figure out how to create an endpoint that can handle all those actions, leading to a lot of extra API endpoints and overwhelming amounts of code. A single form submission could end up saving or updating ten or more records, which need to be processed in a specific order. I'm trying to find a way to simplify this process. Here are some options I'm considering:
1. Create a RESTful API and persuade the designer to break the form into smaller pages, each handling one record submission.
2. Convince them to allow multiple submission buttons for different records on a single page.
3. Implement JavaScript to fire off submissions and handle rollbacks if a submit fails.
4. Perhaps use GraphQL? I have no experience with it though.
5. Should I just accept the current setup? What alternatives do you suggest?

5 Answers

Answered By HybridDevGuru On

Try a hybrid solution! You could maintain the existing user interface while setting up a single API endpoint that takes an array of operations, allowing for rollback if anything goes wrong. This way, designers can still deliver their "page of truth," and developers can keep things organized.

Answered By TechSavvyMaverick On

I think the first option makes the most sense. User experience should take priority over system design most of the time. A more straightforward form will keep things less confusing for users, and the backend can handle the requests more cleanly. Plus, making smaller forms could simplify your API endpoints!

Answered By FrontendWhiz22 On

If your team has more backend developers, you might stick with the current system. But if the frontend team is larger, you might want to shift the responsibility for managing multiple requests to them instead. They could handle orchestrating the submissions more efficiently.

Answered By CodeStrategist99 On

It's tough to give advice without seeing the data structure. If the data is varied, it might be inevitable to have more code. But if there's repetition in your code, consider refactoring to pull out the common parts into reusable components. It could save you time in the long run!

Answered By FormNinja14 On

It might help to create one client-facing endpoint that handles all incoming data as a single JSON payload. Then, process that data within your system, allowing you to unpack and delegate tasks neatly. Just ensure you secure that endpoint well since you're exposing a lot of functionality.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.