refactor(admin): stream_routes/upstreams/protos/services/global_rules/consumer_groups/plugin_configs#8661
Conversation
|
|
||
| utils.fix_count(res.body, id) | ||
| return res.status, res.body | ||
| return need_id and id or true |
There was a problem hiding this comment.
Look like we can move this line to resource.lua?
| schema = core.schema.route, | ||
| checker = check_conf | ||
| checker = check_conf, | ||
| unsupported_methods = {} |
There was a problem hiding this comment.
We can leave this nil as this resource doesn't have unsupported methods.
| kind = "service", | ||
| schema = core.schema.service, | ||
| checker = check_conf, | ||
| unsupported_methods = {}, |
| return self.checker(id, conf, need_id, self.schema) | ||
| local ok, err = self.checker(id, conf, need_id, self.schema) | ||
|
|
||
| if err then |
There was a problem hiding this comment.
Code style, please use if not ok then
|
|
||
| local code, data | ||
| if seg_res == "routes" then | ||
| local refactored_resources = { |
There was a problem hiding this comment.
directly named as resources?
There was a problem hiding this comment.
There has been a global variable named resources already. 😭 (https://github.com/apache/apisix/blob/master/apisix/admin/init.lua#L46)
Maybe we can rename that variable after all resources are refactored.
|
|
||
|
|
||
| function _M:get(id) | ||
| if self.unsupported_methods and core.table.array_find(self.unsupported_methods, "get") then |
There was a problem hiding this comment.
Is it enough to use if core.table.array_find(self.unsupported_methods, "get") then ?
* upstream/master: feat(elasticsearch-logger): support multi elasticsearch endpoints (apache#8604) chore: use operator # instead of string.len (apache#8751) chore: hi 2023 (apache#8748) refactor(admin): stream_routes/upstreams/protos/services/global_rules/consumer_groups/plugin_configs (apache#8661) feat: support send error-log to kafka brokers (apache#8693) chore: upgrade `casbin` to `1.41.5` (apache#8744)
Description
Fixes #8569
Checklist