main
alex 2024-03-06 22:41:51 +01:00
parent 55e61cbf91
commit 0a33f59345
3 changed files with 16 additions and 10 deletions

BIN
main

Binary file not shown.

View File

@ -46,16 +46,17 @@ type CrmTableCustomerResponse struct {
}
type CrmTableCustomer struct {
Id string
Pipeline uint8
DealPhase uint8
FirstName string
LastName string
CreatedAt time.Time
Telephone string
Email string
LastContact time.Time
CreatedBy string
Id string
Pipeline uint8
DealPhase uint8
FirstName string
LastName string
CreatedAt time.Time
Telephone string
Email string
LastContact time.Time
AssignedEmployee string
CreatedBy string
}
func (CrmTableCustomer) TableName() string {

View File

@ -7,6 +7,7 @@ import (
"jannex/admin-dashboard-backend/modules/structs"
"jannex/admin-dashboard-backend/modules/utils"
"jannex/admin-dashboard-backend/socketclients"
"sort"
"time"
"git.ex.umbach.dev/Alex/roese-utils/rslogger"
@ -23,6 +24,10 @@ func GetAllCustomers(c *fiber.Ctx) error {
database.DB.Find(&customers)
sort.Slice(customers, func(i, j int) bool {
return customers[i].CreatedAt.After(customers[j].CreatedAt)
})
return c.JSON(customers)
}