Change GET to POST requests to avoid URL character limits
Browse files- services.py +51 -39
services.py
CHANGED
@@ -91,7 +91,7 @@ def cost_estimator(
|
|
91 |
program_desc: Optional[str] = None
|
92 |
) -> str:
|
93 |
estimate: str = _post_json(
|
94 |
-
"
|
95 |
payload={
|
96 |
"recipient_candid_entity_id": recipient_candid_entity_id,
|
97 |
"program_description": program_desc,
|
@@ -130,59 +130,71 @@ def draft_letter(
|
|
130 |
contact_information: str = ""
|
131 |
):
|
132 |
gr.Info("Writing the letter, please scroll to the top of the page.")
|
133 |
-
opening: str =
|
134 |
"/writer/opening",
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
|
|
|
|
142 |
)
|
143 |
|
144 |
-
recipient_description: str =
|
145 |
"/writer/org",
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
|
|
|
|
152 |
)
|
153 |
|
154 |
-
need_statement: str =
|
155 |
"/writer/need",
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
|
|
|
|
160 |
)
|
161 |
|
162 |
-
project_description: str =
|
163 |
"/writer/project",
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
|
|
|
|
171 |
)
|
172 |
|
173 |
-
funding_request: str =
|
174 |
"/writer/fund",
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
|
|
|
|
179 |
)
|
180 |
|
181 |
-
conclusion: str =
|
182 |
"/writer/conclusion",
|
183 |
-
|
184 |
-
|
185 |
-
|
|
|
|
|
186 |
)
|
187 |
|
188 |
return (
|
@@ -206,7 +218,7 @@ def send_feedback(
|
|
206 |
email: Optional[str] = None
|
207 |
) -> int:
|
208 |
count = _post_json(
|
209 |
-
"
|
210 |
payload={
|
211 |
"context": context,
|
212 |
"letter": letter,
|
|
|
91 |
program_desc: Optional[str] = None
|
92 |
) -> str:
|
93 |
estimate: str = _post_json(
|
94 |
+
"budget",
|
95 |
payload={
|
96 |
"recipient_candid_entity_id": recipient_candid_entity_id,
|
97 |
"program_description": program_desc,
|
|
|
130 |
contact_information: str = ""
|
131 |
):
|
132 |
gr.Info("Writing the letter, please scroll to the top of the page.")
|
133 |
+
opening: str = _post_json(
|
134 |
"/writer/opening",
|
135 |
+
payload=dict(
|
136 |
+
funder_name=funder_name,
|
137 |
+
recipient_name=recipient_name,
|
138 |
+
project_name=project_name,
|
139 |
+
project_purpose=project_purpose,
|
140 |
+
amount=amount,
|
141 |
+
prior_contact=prior_contact,
|
142 |
+
connection=connection
|
143 |
+
)
|
144 |
)
|
145 |
|
146 |
+
recipient_description: str = _post_json(
|
147 |
"/writer/org",
|
148 |
+
payload=dict(
|
149 |
+
opening=opening,
|
150 |
+
recipient_mission_statement=recipient_mission_statement,
|
151 |
+
capacity=capacity,
|
152 |
+
history=recipient_history,
|
153 |
+
path=path_to_solution,
|
154 |
+
accomplishment=recent_accomplishments
|
155 |
+
)
|
156 |
)
|
157 |
|
158 |
+
need_statement: str = _post_json(
|
159 |
"/writer/need",
|
160 |
+
payload=dict(
|
161 |
+
recipient_desc=recipient_description,
|
162 |
+
target=geo_pop_targets,
|
163 |
+
data=project_data_stats,
|
164 |
+
funder_mission_statement=funder_mission_statement
|
165 |
+
)
|
166 |
)
|
167 |
|
168 |
+
project_description: str = _post_json(
|
169 |
"/writer/project",
|
170 |
+
payload=dict(
|
171 |
+
need=need_statement,
|
172 |
+
projects=projects,
|
173 |
+
desired_objectives=desired_objectives,
|
174 |
+
major_activities=major_activities,
|
175 |
+
key_staff=key_staff,
|
176 |
+
stand_out=standout_features,
|
177 |
+
success=success_metric
|
178 |
+
)
|
179 |
)
|
180 |
|
181 |
+
funding_request: str = _post_json(
|
182 |
"/writer/fund",
|
183 |
+
payload=dict(
|
184 |
+
project_desc=project_description,
|
185 |
+
amount=amount,
|
186 |
+
funding_history=mutual_history,
|
187 |
+
other_funding=other_funding_sources
|
188 |
+
)
|
189 |
)
|
190 |
|
191 |
+
conclusion: str = _post_json(
|
192 |
"/writer/conclusion",
|
193 |
+
payload=dict(
|
194 |
+
funding_request=funding_request,
|
195 |
+
project_desc=project_description,
|
196 |
+
follow_up=contact_information
|
197 |
+
)
|
198 |
)
|
199 |
|
200 |
return (
|
|
|
218 |
email: Optional[str] = None
|
219 |
) -> int:
|
220 |
count = _post_json(
|
221 |
+
"feedback",
|
222 |
payload={
|
223 |
"context": context,
|
224 |
"letter": letter,
|