bugfix: Allow static IDs

This commit is contained in:
jamesread 2024-02-23 21:30:13 +00:00
parent b8f23ce80c
commit 6da050e3b9
2 changed files with 8 additions and 4 deletions

View File

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

View File

@ -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 {