membphis commented on code in PR #12317: URL: https://github.com/apache/apisix/pull/12317#discussion_r2144106656
########## apisix/admin/standalone.lua: ########## @@ -34,6 +34,25 @@ local EVENT_UPDATE = "standalone-api-configuration-update" local _M = {} +local function check_duplicate(item, key, id_set) Review Comment: which is much clearer: ```lua local duplicated, err = check_duplicate(item, key, id_set) ``` ########## apisix/admin/standalone.lua: ########## @@ -167,6 +187,13 @@ local function update(ctx) core.response.exit(400, {error_msg = err_prefix .. err}) end end + -- check duplicate resource + local err = check_duplicate(item, key, id_set) + if err then + core.log.error(err) Review Comment: pls add more comments, make it easier to read -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org