From 6b4401b5bebb871e4f3c3a2134a7a2650184ddf7 Mon Sep 17 00:00:00 2001 From: Odetola Taiwo Date: Thu, 27 Jul 2023 02:51:39 +0100 Subject: [PATCH] adjustments --- api/api.go | 6 +++--- api/bill.go | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/api/api.go b/api/api.go index 0547987..0cd62e1 100644 --- a/api/api.go +++ b/api/api.go @@ -22,15 +22,15 @@ type RemoteCalls interface { GetVirtualAccountByBVN(ctx context.Context, bvn string) (*model.VirtualAccount, error) GetVirtualAccountTransaction(ctx context.Context, txID string) (*model.Transaction, error) - GetBillVendors(ctx context.Context, category string) (*[]model.Vendor, error) + GetBillVendors(ctx context.Context, category string) ([]*model.Vendor, error) GetBillVendorByID(ctx context.Context, vendorID string) (*model.Vendor, error) - GetBillProducts(ctx context.Context, vendorID, category *string) (*[]model.Product, error) + GetBillProducts(ctx context.Context, vendorID, category *string) ([]*model.Product, error) GetBillProductByID(ctx context.Context, productID string) (*model.Product, error) RunCustomerLookup(ctx context.Context, customerID string, productID string) (*model.Product, error) CreateBill(ctx context.Context, request model.CreateBillRequest) (*model.CreateBillResponse, error) GetBillByID(ctx context.Context, id string) (*model.BillData, error) GetBillByReference(ctx context.Context, reference string) (*model.BillData, error) - GetAllBills(ctx context.Context, request model.GetAllBillsRequest) (*[]model.BillData, error) + GetAllBills(ctx context.Context, request model.GetAllBillsRequest) ([]*model.BillData, error) } // Call object diff --git a/api/bill.go b/api/bill.go index 7ee8142..e502b23 100644 --- a/api/bill.go +++ b/api/bill.go @@ -10,8 +10,8 @@ import ( ) // GetBillVendors makes the request to get bill vendors -func (c *Call) GetBillVendors(ctx context.Context, category string) (*[]model.Vendor, error) { - response := &[]model.Vendor{} +func (c *Call) GetBillVendors(ctx context.Context, category string) ([]*model.Vendor, error) { + var response []*model.Vendor path := "/bills/vendors" @@ -42,8 +42,8 @@ func (c *Call) GetBillVendorByID(ctx context.Context, vendorID string) (*model.V } // GetBillProducts makes the request to get products -func (c *Call) GetBillProducts(ctx context.Context, vendorID, category *string) (*[]model.Product, error) { - response := &[]model.Product{} +func (c *Call) GetBillProducts(ctx context.Context, vendorID, category *string) ([]*model.Product, error) { + var response []*model.Product path := "/bills/products" params := url.Values{} @@ -137,9 +137,9 @@ func (c *Call) GetBillByReference(ctx context.Context, reference string) (*model } // GetAllBills makes the request to get all bills -func (c *Call) GetAllBills(ctx context.Context, request model.GetAllBillsRequest) (*[]model.BillData, error) { +func (c *Call) GetAllBills(ctx context.Context, request model.GetAllBillsRequest) ([]*model.BillData, error) { - response := &[]model.BillData{} + var response []*model.BillData path := "/bills"