sorsort
parent
55e61cbf91
commit
0a33f59345
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue