Skip to content

Commit 7c3320e

Browse files
committed
fixes on cards and invoices
1 parent f0c8658 commit 7c3320e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

endpoints/subscription.endpoint.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ func (subscriptionEndpoint *SubscriptionEndpoint) GetCustomerInvoices(ctx *fiber
6565
account, _ := userEndpoint.CurrentAccount(ctx)
6666
sCustomerInvoices, err := subscriptionService.GetCustomerInvoices(account.ID)
6767
if err != nil {
68-
return ctx.Status(401).JSON(fiber.Map{
69-
"message": err.Error(),
70-
})
68+
ctx.JSON([]string{})
69+
}
70+
if len(sCustomerInvoices) == 0 {
71+
return ctx.JSON([]string{})
7172
}
7273
return ctx.JSON(sCustomerInvoices)
7374
}
@@ -82,9 +83,10 @@ func (subscriptionEndpoint *SubscriptionEndpoint) GetCustomerCards(ctx *fiber.Ct
8283
account, _ := userEndpoint.CurrentAccount(ctx)
8384
sCustomerCards, err := subscriptionService.GetCustomerCards(account.ID)
8485
if err != nil {
85-
return ctx.Status(401).JSON(fiber.Map{
86-
"message": err.Error(),
87-
})
86+
ctx.JSON([]string{})
87+
}
88+
if len(sCustomerCards) == 0 {
89+
return ctx.JSON([]string{})
8890
}
8991
return ctx.JSON(sCustomerCards)
9092
}

0 commit comments

Comments
 (0)