File tree Expand file tree Collapse file tree 3 files changed +1
-28
lines changed
Expand file tree Collapse file tree 3 files changed +1
-28
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import {
1313 checkErrors ,
1414 defaultValues ,
1515 emptyValues ,
16- refreshStudioCSRFToken ,
1716 teamSize
1817} from './utils'
1918import { studioContactUsApi } from '../../utils/externalUrls'
@@ -116,12 +115,10 @@ const RequestAQuoteForm = ({
116115 }
117116
118117 try {
119- const csrfToken = await refreshStudioCSRFToken ( )
120118 const response = await fetch ( studioContactUsApi , {
121119 method : `POST` ,
122120 headers : {
123- 'Content-Type' : `application/json` ,
124- 'X-CsrfToken' : csrfToken
121+ 'Content-Type' : `application/json`
125122 } ,
126123 credentials : `include` ,
127124 mode : `cors` ,
Original file line number Diff line number Diff line change 1- import { studioRefreshCsfrApi } from '../../utils/externalUrls'
2-
31export type FormField =
42 | 'name'
53 | 'company'
@@ -82,24 +80,3 @@ export const checkErrors = (
8280
8381 return { hasError, newErrors }
8482}
85-
86- function getCookie ( name : string ) {
87- let cookieValue = null
88- if ( document . cookie && document . cookie !== `` ) {
89- const cookies = document . cookie . split ( `;` )
90- for ( let i = 0 ; i < cookies . length ; i ++ ) {
91- const cookie = cookies [ i ] . trim ( )
92- // Does this cookie string begin with the name we want?
93- if ( cookie . substring ( 0 , name . length + 1 ) === name + `=` ) {
94- cookieValue = decodeURIComponent ( cookie . substring ( name . length + 1 ) )
95- break
96- }
97- }
98- }
99- return cookieValue
100- }
101-
102- export const refreshStudioCSRFToken = async ( ) => {
103- await fetch ( studioRefreshCsfrApi )
104- return getCookie ( `csrftoken` ) || ``
105- }
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ export const studioUrl = 'https://studio.datachain.ai'
44
55// Studio API Urls
66const studioApi = `${ studioUrl } /api`
7- export const studioRefreshCsfrApi = `${ studioApi } /refresh-csrf`
87export const studioContactUsApi = `${ studioApi } /contacts`
98
109// Github Urls
You can’t perform that action at this time.
0 commit comments