Skip to content

Commit

Permalink
modify api to return department in the search result
Browse files Browse the repository at this point in the history
  • Loading branch information
mhewedy committed Feb 12, 2020
1 parent 651caa2 commit a0a7213
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion mego-api/attendess/attendees.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ type Attendee struct {
DisplayName string `json:"display_name"`
Title string `json:"title,omitempty"`
EmailAddress string `json:"email_address"`
Department string `json:"department,omitempty"`
Image string `json:"image,omitempty"`
details *AttendeeDetails `json:"-"` // for caching only
}

type AttendeeDetails struct {
Attendee
Department string `json:"department,omitempty"`
BusinessPhoneNumber string `json:"business_phone_numbers,omitempty"`
MobilePhone string `json:"mobile_phone,omitempty"`
OfficeLocation string `json:"office_location,omitempty"`
Expand Down Expand Up @@ -124,6 +124,7 @@ func getAttendeesStartsWith(s string, u *user.User) []Attendee {
Title: p.Title,
EmailAddress: p.EmailAddress.EmailAddress,
PersonaId: p.PersonaId.Id,
Department: p.Departments.StringAttributedValue.Value,
}
}
return attendees
Expand Down
2 changes: 1 addition & 1 deletion mego-api/attendess/details.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ func getAttendeeDetails(c ews.Client, e string) (*AttendeeDetails, error) {
}

attendee.Image = base64
attendee.Department = persona.Department // make sure attendee continue to return even if not returned at index time
attendee.details = &AttendeeDetails{
Attendee: attendee,
Department: persona.Department,
BusinessPhoneNumber: persona.BusinessPhoneNumbers.PhoneNumberAttributedValue.Value.Number,
MobilePhone: persona.MobilePhones.PhoneNumberAttributedValue.Value.Number,
OfficeLocation: persona.OfficeLocations.StringAttributedValue.Value,
Expand Down
2 changes: 1 addition & 1 deletion mego-api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/gorilla/handlers v1.4.2
github.com/gorilla/mux v1.7.3
github.com/markbates/pkger v0.12.8
github.com/mhewedy/ews v1.0.14
github.com/mhewedy/ews v1.0.15
github.com/mhewedy/go-conf v0.0.2
github.com/mhewedy/httputil v0.0.0-20200211200408-e8eab4286fdb
github.com/schollz/progressbar/v2 v2.14.2
Expand Down
4 changes: 2 additions & 2 deletions mego-api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/markbates/pkger v0.12.8 h1:4mEUzWb1HzRnxPwUevBX8g8ntsQ4rWw2R8CRB2QdZVI=
github.com/markbates/pkger v0.12.8/go.mod h1:C7e5A6bnWZT+nXkUwkvysGW7sxl/IGd63HEa6N/JY8s=
github.com/mhewedy/ews v1.0.14 h1:NlY9qsZDYw6QMR/OZYp5Vft4wNSKiPZ+1dZuufjPGqQ=
github.com/mhewedy/ews v1.0.14/go.mod h1:7fnoMCq3EPNOFdYk3IePteLF6nOKuhAOuPfpwcLdVxU=
github.com/mhewedy/ews v1.0.15 h1:BEPv1bRXmD6IDKmREdJk0muCjWkm8r/0hZv8EUL70Ko=
github.com/mhewedy/ews v1.0.15/go.mod h1:7fnoMCq3EPNOFdYk3IePteLF6nOKuhAOuPfpwcLdVxU=
github.com/mhewedy/go-conf v0.0.2 h1:9yg9VojrRYsRFzRJfKwLYIMX2l9hH8OIX6RNldiAHD8=
github.com/mhewedy/go-conf v0.0.2/go.mod h1:kR0G8WzB8R6SCs76XLNSJU6umRx1e+ATYKYx1BJLXvY=
github.com/mhewedy/httputil v0.0.0-20200211200408-e8eab4286fdb h1:g33G13DiPLPYT2ozR2yRuLFIyARz3RYa7XCO9K2AVq8=
Expand Down

0 comments on commit a0a7213

Please sign in to comment.