Skip to content

Instantly share code, notes, and snippets.

@SidneyAllen
Last active November 11, 2021 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SidneyAllen/5a80814e477a04a3bb754ac149e9bee6 to your computer and use it in GitHub Desktop.
Save SidneyAllen/5a80814e477a04a3bb754ac149e9bee6 to your computer and use it in GitHub Desktop.
export default function () {
// update getSuggestions function
async function getSuggestions(val) {
const config = {
method: 'POST',
headers: new Headers({
'Authorization': 'Basic ' + btoa(`${import.meta.env.VITE_LOB_API_KEY}:`),
'Content-Type': 'application/json'
}),
body: JSON.stringify({
"address_prefix": import.meta.env.PROD ? val : '5 sugg'
})
}
}
return { getSuggestions }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment