refactor(helcim): normalize listHelcimCustomerCards return shape
This commit is contained in:
parent
27e73e969a
commit
134aef6ab0
6 changed files with 58 additions and 33 deletions
|
|
@ -9,10 +9,7 @@ export default defineEventHandler(async (event) => {
|
|||
return { cardToken: null }
|
||||
}
|
||||
|
||||
const cardsResponse = await listHelcimCustomerCards(member.helcimCustomerId)
|
||||
const cards = Array.isArray(cardsResponse)
|
||||
? cardsResponse
|
||||
: (cardsResponse?.cards || cardsResponse?.data || [])
|
||||
const cards = await listHelcimCustomerCards(member.helcimCustomerId)
|
||||
|
||||
if (!cards.length) {
|
||||
return { cardToken: null }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue