Skip to content

Commit

Permalink
tg
Browse files Browse the repository at this point in the history
  • Loading branch information
Malvere committed Jan 30, 2024
1 parent 21bbfb6 commit 3231de3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,20 @@ const state = ref({
})
onMounted(async () => {
const uid = WebApp.initDataUnsafe.user.id
// const uid = "1380381516"
console.log(uid)
console.log(state.value)
try {
const response = await fetch(apiEndpoints.key, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ user_id: String(uid) })
body: JSON.stringify({ user_id: uid.toString() })
})
if (!response.ok) {
throw new Error(`Failed with ${response.status}`)
}
state.value.hasResponse = true
response.json().then((data) => (state.value.key = data.key))
console.log(state.value)
console.log(response.json())
} catch (error) {
console.error('Error fetching HMAC key: ', error)
}
Expand Down

0 comments on commit 3231de3

Please sign in to comment.