Skip to content

Commit

Permalink
use dynamic forms instead
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-cook committed Jan 26, 2023
1 parent caceb20 commit 2978c4c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions utils/api/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,11 @@ export const createRequest = async ({ data, wareID }) => {
export const useInitializeRequest = (id) => {
const { data, error } = useSWR(`/wares/${id}/quote_groups.json`, fetcher)
let dynamicForm = { name: data?.name }
let dynamicFormInfo = data?.dynamic_forms[0]

if (data?.dynamic_form) {
const defaultSchema = data.dynamic_form.schema
const defaultOptions = data.dynamic_form.options
if (dynamicFormInfo) {
const defaultSchema = dynamicFormInfo.schema
const defaultOptions = dynamicFormInfo.options
const schema = dynamicFormSchema(defaultSchema)

dynamicForm = {
Expand Down

0 comments on commit 2978c4c

Please sign in to comment.