Skip to content

Commit

Permalink
remove useless check of table
Browse files Browse the repository at this point in the history
  • Loading branch information
An-DJ committed Jan 17, 2023
1 parent 647489b commit 0b98552
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions apisix/admin/resource.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ end


function _M:get(id)
if self.unsupported_methods and core.table.array_find(self.unsupported_methods, "get") then
if core.table.array_find(self.unsupported_methods, "get") then
return 405, {error_msg = "not supported `GET` method for " .. self.kind}
end

Expand All @@ -89,7 +89,7 @@ end


function _M:post(id, conf, sub_path, args)
if self.unsupported_methods and core.table.array_find(self.unsupported_methods, "post") then
if core.table.array_find(self.unsupported_methods, "post") then
return 405, {error_msg = "not supported `POST` method for " .. self.kind}
end

Expand Down Expand Up @@ -117,7 +117,7 @@ end


function _M:put(id, conf, sub_path, args)
if self.unsupported_methods and core.table.array_find(self.unsupported_methods, "put") then
if core.table.array_find(self.unsupported_methods, "put") then
return 405, {error_msg = "not supported `PUT` method for " .. self.kind}
end

Expand Down Expand Up @@ -149,7 +149,7 @@ end


function _M:delete(id)
if self.unsupported_methods and core.table.array_find(self.unsupported_methods, "delete") then
if core.table.array_find(self.unsupported_methods, "delete") then
return 405, {error_msg = "not supported `DELETE` method for " .. self.kind}
end

Expand All @@ -176,7 +176,7 @@ end


function _M:patch(id, conf, sub_path, args)
if self.unsupported_methods and core.table.array_find(self.unsupported_methods, "patch") then
if core.table.array_find(self.unsupported_methods, "patch") then
return 405, {error_msg = "not supported `PATCH` method for " .. self.kind}
end

Expand Down

0 comments on commit 0b98552

Please sign in to comment.