From cb16765b98a2d6c500a7606fc18056db564a48db Mon Sep 17 00:00:00 2001 From: fengzero Date: Thu, 21 Aug 2025 02:59:26 +0000 Subject: [PATCH] subs api: response ok when request empty --- plugins/restful/group_config_handle.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/restful/group_config_handle.c b/plugins/restful/group_config_handle.c index 3f185fa99..00b66880d 100644 --- a/plugins/restful/group_config_handle.c +++ b/plugins/restful/group_config_handle.c @@ -406,10 +406,16 @@ void handle_grp_subscribes(nng_aio *aio) NEU_PROCESS_HTTP_REQUEST_VALIDATE_JWT( aio, neu_json_subscribe_groups_req_t, neu_json_decode_subscribe_groups_req, { - int ret = send_subscribe_groups(aio, req); - if (0 != ret) { + int ret = 0; + if (req->n_group == 0) { NEU_JSON_RESPONSE_ERROR( ret, { neu_http_response(aio, ret, result_error); }); + } else { + ret = send_subscribe_groups(aio, req); + if (0 != ret) { + NEU_JSON_RESPONSE_ERROR( + ret, { neu_http_response(aio, ret, result_error); }); + } } }) }