Skip to content

Commit a43619f

Browse files
author
Ruben van Leeuwen
committed
Reverts main.py and page.tsx
1 parent 3983ace commit a43619f

File tree

2 files changed

+36
-40
lines changed

2 files changed

+36
-40
lines changed

backend/main.py

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def example_backend_validation(val: int) -> bool:
8080

8181
NumberExample = Annotated[
8282
int,
83-
Ge(8),
83+
Ge(18),
8484
Le(99),
8585
MultipleOf(multiple_of=3),
8686
Predicate(example_backend_validation),
@@ -165,61 +165,61 @@ def form_generator(state: State):
165165
class TestForm0(FormPage):
166166
model_config = ConfigDict(title="Form Title Page 1")
167167

168-
number: NumberExample = ["1", "2", "3"]
169-
personList: TestPersonList
168+
number: NumberExample
169+
list: TestExampleNumberList
170+
# list_list: unique_conlist(TestExampleNumberList, min_items=1, max_items=5)
171+
# list_list_list: unique_conlist(
172+
# unique_conlist(Person2, min_items=1, max_items=5),
173+
# min_items=1,
174+
# max_items=2,
175+
# ) = [1, 2]
176+
test: TestString
177+
textList: unique_conlist(TestString, min_items=1, max_items=5)
178+
# numberList: TestExampleNumberList = [1, 2]
179+
person: Person2
180+
personList: unique_conlist(Person2, min_items=2, max_items=5)
181+
# ingleNumber: NumberExample
182+
# number0: Annotated[int, Ge(18), Le(99)] = 17
170183

171184
form_data_0 = yield TestForm0
172185

173186
class TestForm1(FormPage):
174187
model_config = ConfigDict(title="Form Title Page 1")
175188

176-
contact_name2: TestString = "RRR"
189+
contact_name2: StringExample
177190
options: ListChoices
178191

179192
form_data_1 = yield TestForm1
180193

181-
class TestForm2(SubmitFormPage):
194+
class TestForm2(FormPage):
182195
model_config = ConfigDict(title="Form Title Page 2")
183196

184-
contact_name3: TestString = "Ruben"
197+
contact_name3: StringExample
185198
age: NumberExample
186199

187200
form_data_2 = yield TestForm2
188201

202+
class TestForm3(FormPage):
203+
model_config = ConfigDict(title="Form Title Page 3")
204+
205+
contact_person: Person
206+
207+
form_data_3 = yield TestForm3
208+
209+
class TestForm5(FormPage):
210+
model_config = ConfigDict(title="Form Title Page 4")
211+
212+
contact_person_list: TestPersonList
213+
214+
form_data_5 = yield TestForm5
215+
189216
return (
190217
form_data_0.model_dump()
191218
| form_data_1.model_dump()
192219
| form_data_2.model_dump()
220+
| form_data_3.model_dump()
221+
| form_data_5.model_dump()
193222
)
194223

195224
post_form(form_generator, state={}, user_inputs=form_data)
196225
return "OK!"
197-
198-
# list: TestExampleNumberList
199-
# list_list: unique_conlist(TestExampleNumberList, min_items=1, max_items=5)
200-
# list_list_list: unique_conlist(
201-
# unique_conlist(Person2, min_items=1, max_items=5),
202-
# min_items=1,
203-
# max_items=2,
204-
# ) = [1, 2]
205-
# test: TestString
206-
# textList: unique_conlist(TestString, min_items=1, max_items=5)
207-
# numberList: TestExampleNumberList = [1, 2]
208-
# person: Person2
209-
# personList: unique_conlist(Person2, min_items=2, max_items=5)
210-
# ingleNumber: NumberExample
211-
# number0: Annotated[int, Ge(18), Le(99)] = 17
212-
213-
# class TestForm3(FormPage):
214-
# model_config = ConfigDict(title="Form Title Page 3")
215-
216-
# contact_person: Person
217-
218-
# form_data_3 = yield TestForm3
219-
220-
# class TestForm5(FormPage):
221-
# model_config = ConfigDict(title="Form Title Page 4")
222-
223-
# contact_person_list: TestPersonList
224-
225-
# form_data_5 = yield TestForm5

frontend/apps/example/src/app/page.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,10 @@ export default function Home() {
2121
const pydanticFormApiProvider: PydanticFormApiProvider = async ({
2222
requestBody,
2323
}) => {
24-
const portsUrl =
25-
'https://orchestrator.dev.automation.surf.net/api/processes/create_sn8_service_port?productId=9a8bd1ea-6650-4900-b820-3c7f0f16ef1d';
26-
const localUrl = 'http://localhost:8000/form';
27-
const fetchResult = await fetch(localUrl, {
24+
const fetchResult = await fetch('http://localhost:8000/form', {
2825
method: 'POST',
2926
headers: {
3027
'Content-Type': 'application/json',
31-
Authorization: 'Bearer INSERT_YOUR_JWT_TOKEN_HERE', // Replace with your JWT token
3228
},
3329
body: JSON.stringify(requestBody),
3430
});

0 commit comments

Comments
 (0)