🚸 (webhook) Also add atomic deep keys selection

This commit is contained in:
Baptiste Arnaud
2023-03-02 11:34:57 +01:00
parent 506fe003d1
commit 73f4846e1b
2 changed files with 39 additions and 8 deletions

View File

@@ -130,7 +130,39 @@ export const WebhookSettings = ({
if (error)
return showToast({ title: error.name, description: error.message })
setTestResponse(JSON.stringify(data, undefined, 2))
setResponseKeys(getDeepKeys(data))
setResponseKeys(
getDeepKeys({
employees: [
{
name: 'Shyam',
email: 'shyamjaiswal@gmail.com',
employees: [
{ name: 'Shyam', email: 'shyamjaiswal@gmail.com' },
{ name: 'Bob', email: 'bob32@gmail.com' },
{ name: 'Jai', email: 'jai87@gmail.com' },
],
},
{
name: 'Bob',
email: 'bob32@gmail.com',
employees: [
{ name: 'Shyam', email: 'shyamjaiswal@gmail.com' },
{ name: 'Bob', email: 'bob32@gmail.com' },
{ name: 'Jai', email: 'jai87@gmail.com' },
],
},
{
name: 'Jai',
email: 'jai87@gmail.com',
employees: [
{ name: 'Shyam', email: 'shyamjaiswal@gmail.com' },
{ name: 'Bob', email: 'bob32@gmail.com' },
{ name: 'Jai', email: 'jai87@gmail.com' },
],
},
],
})
)
setIsTestResponseLoading(false)
}