File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -225,6 +225,32 @@ export default function UserSettingsPage() {
225225 if ( ! res . ok ) {
226226 throw new Error ( "Failed to save profile" ) ;
227227 }
228+
229+ // Submit to Ortto directly from client (no secrets needed)
230+ const topicLabels = form . topics . map (
231+ ( code ) => config ?. topics ?. [ code ] || code
232+ ) ;
233+ try {
234+ const orttoRes = await fetch ( "https://ortto.wri.org/custom-forms/gnw/" , {
235+ method : "POST" ,
236+ headers : { "Content-Type" : "application/json" } ,
237+ body : JSON . stringify ( {
238+ email : form . email ,
239+ firstName : form . firstName ,
240+ lastName : form . lastName ,
241+ sector : form . sector ,
242+ jobTitle : form . jobTitle ,
243+ companyOrganization : form . company ,
244+ countryCode : form . country ,
245+ Topics : topicLabels ,
246+ receiveNewsEmails : form . receiveNewsEmails ,
247+ } ) ,
248+ } ) ;
249+ console . log ( "[Client] Ortto submission status:" , orttoRes . status , orttoRes . ok ? "OK" : "FAILED" ) ;
250+ } catch ( e ) {
251+ console . error ( "[Client] Ortto submission error:" , e ) ;
252+ }
253+
228254 toaster . create ( {
229255 title : "Profile saved" ,
230256 description : "Your changes have been saved successfully." ,
You can’t perform that action at this time.
0 commit comments