jamesread пре 2 година
родитељ
комит
6da050e3b9
2 измењених фајлова са 8 додато и 4 уклоњено
  1. 1 1
      OliveTin.proto
  2. 7 3
      internal/grpcapi/grpcApiActions.go

+ 1 - 1
OliveTin.proto

@@ -251,7 +251,7 @@ service OliveTinApiService {
 
 	rpc DumpPublicIdActionMap(DumpPublicIdActionMapRequest) returns (DumpPublicIdActionMapResponse) {
 		option (google.api.http) = {
-			get: "/api/DumpPublicIdActionMap"
+			get: "/api/DumpPublicActionMap"
 		};
 	}
 

+ 7 - 3
internal/grpcapi/grpcApiActions.go

@@ -118,10 +118,14 @@ func buildChoices(choices []config.ActionArgumentChoice) []*pb.ActionArgumentCho
 }
 
 func createPublicID(action *config.Action, entityPrefix string) string {
-	h := sha256.New()
-	h.Write([]byte(action.ID + "." + entityPrefix))
+	if action.Entity == "" {
+		return action.ID
+	} else {
+		h := sha256.New()
+		h.Write([]byte(action.ID + "." + entityPrefix))
 
-	return fmt.Sprintf("%x", h.Sum(nil))
+		return fmt.Sprintf("%x", h.Sum(nil))
+	}
 }
 
 func findActionByPublicID(id string) *config.Action {