feat: show customer names

This commit is contained in:
Vlad Stan 2023-03-27 17:36:08 +03:00
parent 89f46fff35
commit a719517b9c
5 changed files with 19 additions and 38 deletions

View file

@ -12,7 +12,7 @@ async function directMessages(path) {
},
data: function () {
return {
customersPublicKeys: [],
customers: [],
messages: [],
newMessage: ''
}
@ -40,14 +40,15 @@ async function directMessages(path) {
LNbits.utils.notifyApiError(error)
}
},
getCustomersPublicKeys: async function () {
getCustomers: async function () {
try {
const {data} = await LNbits.api.request(
'GET',
'/nostrmarket/api/v1/customers',
this.inkey
)
this.customersPublicKeys = data
this.customers = data
console.log('### customers', this.customers)
} catch (error) {
LNbits.utils.notifyApiError(error)
}
@ -85,7 +86,7 @@ async function directMessages(path) {
}
},
created: async function () {
await this.getCustomersPublicKeys()
await this.getCustomers()
}
})
}