| 160 | } |
| 161 | |
| 162 | const getSession = async () => { |
| 163 | const options = { |
| 164 | method: 'POST', |
| 165 | headers: { 'content-type': 'application/json' }, |
| 166 | body: JSON.stringify({ |
| 167 | user_id: userId, |
| 168 | scope: props.version === 'San Francisco' ? 'SF' : 'USA', |
| 169 | }), |
| 170 | } |
| 171 | |
| 172 | fetch(api_endpoint + '/api/session', options) |
| 173 | .then((response) => response.json()) |
| 174 | .then((response) => { |
| 175 | sessionId = response.session_id |
| 176 | }) |
| 177 | .catch((error) => { |
| 178 | console.log('error', error) |
| 179 | capturePosthog('backend_error', error) |
| 180 | }) |
| 181 | } |
| 182 | |
| 183 | const getSuggestionForFailedQuery = async () => { |
| 184 | currentSuggestionId = null |