mirror of
				https://github.com/abhinavxd/libredesk.git
				synced 2025-11-04 05:53:30 +00:00 
			
		
		
		
	feat: custom attributes for contacts and conversations
This commit is contained in:
		
							
								
								
									
										15
									
								
								cmd/init.go
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								cmd/init.go
									
									
									
									
									
								
							@@ -23,6 +23,7 @@ import (
 | 
			
		||||
	"github.com/abhinavxd/libredesk/internal/conversation/priority"
 | 
			
		||||
	"github.com/abhinavxd/libredesk/internal/conversation/status"
 | 
			
		||||
	"github.com/abhinavxd/libredesk/internal/csat"
 | 
			
		||||
	customAttribute "github.com/abhinavxd/libredesk/internal/custom_attribute"
 | 
			
		||||
	"github.com/abhinavxd/libredesk/internal/inbox"
 | 
			
		||||
	"github.com/abhinavxd/libredesk/internal/inbox/channel/email"
 | 
			
		||||
	imodels "github.com/abhinavxd/libredesk/internal/inbox/models"
 | 
			
		||||
@@ -793,6 +794,20 @@ func initSearch(db *sqlx.DB, i18n *i18n.I18n) *search.Manager {
 | 
			
		||||
	return m
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// initCustomAttribute inits custom attribute manager.
 | 
			
		||||
func initCustomAttribute(db *sqlx.DB, i18n *i18n.I18n) *customAttribute.Manager {
 | 
			
		||||
	lo := initLogger("custom-attribute")
 | 
			
		||||
	m, err := customAttribute.New(customAttribute.Opts{
 | 
			
		||||
		DB:   db,
 | 
			
		||||
		Lo:   lo,
 | 
			
		||||
		I18n: i18n,
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		log.Fatalf("error initializing custom attribute manager: %v", err)
 | 
			
		||||
	}
 | 
			
		||||
	return m
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// initLogger initializes a logf logger.
 | 
			
		||||
func initLogger(src string) *logf.Logger {
 | 
			
		||||
	lvl, env := ko.MustString("app.log_level"), ko.MustString("app.env")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user