@@ -64,14 +64,14 @@ func processCommand(data ApiRequestData) (interface{}, error) {
6464 return nil , fmt .Errorf ("expected a string for domain: %v" , err )
6565 }
6666 fmt .Println ("Searching by domain:" , domain )
67- return getOrgId (domain )
67+ return getOrgsByDomain (domain )
6868
6969 case "search_by_ror_id" :
7070 // Try to parse as array
7171 var ids []string
7272 if err := json .Unmarshal (data .Value , & ids ); err == nil {
7373 fmt .Println ("Searching by multiple ROR IDs:" , ids )
74- return getOrgDetails (ids )
74+ return getOrgsById (ids )
7575 }
7676
7777 // If not an array, try to parse as a single ID
@@ -81,14 +81,14 @@ func processCommand(data ApiRequestData) (interface{}, error) {
8181 }
8282
8383 fmt .Println ("Searching by single ROR ID:" , id )
84- return getOrgDetails ([]string {id })
84+ return getOrgsById ([]string {id })
8585
8686 default :
8787 return nil , fmt .Errorf ("unknown command %s" , data .Cmd )
8888 }
8989}
9090
91- func getOrgDetails (rorIDs []string ) (interface {}, error ) {
91+ func getOrgsById (rorIDs []string ) (interface {}, error ) {
9292 var result []interface {}
9393
9494 for _ , rorID := range rorIDs {
@@ -114,7 +114,7 @@ func getOrgDetails(rorIDs []string) (interface{}, error) {
114114}
115115
116116
117- func getOrgId (domain string ) (interface {}, error ) {
117+ func getOrgsByDomain (domain string ) (interface {}, error ) {
118118 // Hash the domain
119119 hash := sha256 .Sum256 ([]byte (domain ))
120120 hashedDomain := hex .EncodeToString (hash [:])
@@ -132,7 +132,7 @@ func getOrgId(domain string) (interface{}, error) {
132132 rorIDs := strings .Split (strings .TrimSpace (string (content )), "\n " )
133133
134134 // Get org details for those ROR IDs
135- orgDetails , err := getOrgDetails (rorIDs )
135+ orgDetails , err := getOrgsById (rorIDs )
136136 if err != nil {
137137 return nil , fmt .Errorf ("error retrieving org details: %v" , err )
138138 }
0 commit comments