From 0a3c0d219b88290b389ed196a25a3d39e2c252da Mon Sep 17 00:00:00 2001 From: cangui Date: Fri, 9 May 2025 16:20:29 +0200 Subject: [PATCH] kdf;dfldfl --- backend/handlers/main.go | 4 ++-- backend/models/models.go | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/handlers/main.go b/backend/handlers/main.go index b19aac8..5e765c9 100644 --- a/backend/handlers/main.go +++ b/backend/handlers/main.go @@ -333,7 +333,7 @@ func WebhookReceiveHandler(db *gorm.DB) http.HandlerFunc { messages := value["messages"].([]interface{}) if len(messages) > 0 { msg := messages[0].(map[string]interface{}) - from := msg["from"].(string) + //from := msg["from"].(string) msgType := msg["type"].(string) msgID := msg["id"].(string) @@ -354,7 +354,7 @@ func WebhookReceiveHandler(db *gorm.DB) http.HandlerFunc { conv := models.Conversation{ UserID: user.ID, - From: from, + From: user.NameClient, To: recipientID, MessageID: msgID, Type: msgType, diff --git a/backend/models/models.go b/backend/models/models.go index 29eed3a..3dc6c36 100644 --- a/backend/models/models.go +++ b/backend/models/models.go @@ -19,8 +19,9 @@ type User struct { CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` - - Password string `gorm:"not null"` // hashé avec bcrypt + + NameClient string `gorm:"not null"` + Password string `gorm:"not null"` // hashé avec bcrypt Email string `gorm:"uniqueIndex;not null"` SSOID string `gorm:"uniqueIndex;not null"` Role UserRole `gorm:"type:enum('ADMIN','CLIENT');default:'CLIENT';not null"`