mirror of
https://github.com/Dvorinka/PPve.git
synced 2026-06-05 04:52:58 +00:00
Add files via upload
This commit is contained in:
@@ -20,6 +20,7 @@ type Contact struct {
|
|||||||
Position string `json:"position"`
|
Position string `json:"position"`
|
||||||
Phone string `json:"phone,omitempty"`
|
Phone string `json:"phone,omitempty"`
|
||||||
ServicePhone string `json:"service_phone,omitempty"`
|
ServicePhone string `json:"service_phone,omitempty"`
|
||||||
|
Internal bool `json:"internal"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ContactData struct {
|
type ContactData struct {
|
||||||
@@ -301,12 +302,16 @@ func cleanPhoneNumber(phone string) string {
|
|||||||
|
|
||||||
func processContacts(contacts []Contact) *ContactData {
|
func processContacts(contacts []Contact) *ContactData {
|
||||||
var data ContactData
|
var data ContactData
|
||||||
data.InternalContacts = []Contact{} // Initialize as empty array
|
data.Contacts = []Contact{}
|
||||||
|
data.InternalContacts = []Contact{}
|
||||||
|
|
||||||
for _, contact := range contacts {
|
for _, contact := range contacts {
|
||||||
if strings.Contains(contact.Name, "Interní") {
|
// Check for internal contacts (either name contains "Interní" or position starts with "Interní")
|
||||||
|
if strings.Contains(contact.Name, "Interní") || strings.HasPrefix(contact.Position, "Interní") {
|
||||||
|
contact.Internal = true
|
||||||
data.InternalContacts = append(data.InternalContacts, contact)
|
data.InternalContacts = append(data.InternalContacts, contact)
|
||||||
} else {
|
} else {
|
||||||
|
contact.Internal = false
|
||||||
data.Contacts = append(data.Contacts, contact)
|
data.Contacts = append(data.Contacts, contact)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user