diff --git a/core/views/hooks.py b/core/views/hooks.py index 896e79e..379f40a 100644 --- a/core/views/hooks.py +++ b/core/views/hooks.py @@ -125,11 +125,17 @@ class HookAPI(APIView): def get(self, request, hook_name): try: - hook = Hook.objects.get(name=hook_name) + hook = Hook.objects.get(hook=hook_name) except Hook.DoesNotExist: return HttpResponseBadRequest("Hook does not exist.") + signals = Signal.objects.filter(hook=hook) - return_data = {"name": hook.name, "hook": hook.hook, "hook_id": hook.id} + return_data = { + "name": hook.name, + "hook": hook.hook, + "hook_id": hook.id, + "signals": len(signals), + } return HttpResponse(orjson.dumps(return_data), content_type="application/json")