a lot of renames

This commit is contained in:
counterweight 2025-02-12 16:16:27 +01:00
parent 966fde1111
commit 619503e799
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
9 changed files with 80 additions and 73 deletions

View file

@ -1,27 +1,25 @@
function acceptInvite() {
const npub = window.nostr.getPublicKey();
async function acceptInvite() {
const publicKey = await window.nostr.getPublicKey();
npub.then(async function (npub) {
try {
const response = await fetch('/api/invited-npub', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"npub": npub
})
});
try {
const response = await fetch('/api/sign-public-key-up', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
publicKey
})
});
if (response.ok) {
const data = await response.json();
console.log('invited-npub record created successfully:', data);
} else {
const error = await response.json();
console.error('Failed to create invited-npub record:', error);
}
} catch (error) {
console.error('An error occurred:', error);
if (response.ok) {
const data = await response.json();
console.log('invited-npub record created successfully:', data);
} else {
const error = await response.json();
console.error('Failed to create invited-npub record:', error);
}
});
} catch (error) {
console.error('An error occurred:', error);
}
}