SkyeYoung commented on code in PR #3004: URL: https://github.com/apache/apisix-dashboard/pull/3004#discussion_r2063609939
########## src/apis/plugins.ts: ########## @@ -1,9 +1,23 @@ import { API_GLOBAL_RULES } from '@/config/constant'; import { req } from '@/config/req'; import type { A6Type } from '@/types/schema/apisix'; +import { queryOptions } from '@tanstack/react-query'; -export const putGlobalRuleReq = (data: A6Type['GlobalRulePut']) => - req.put<A6Type['GlobalRulePut'], A6Type['RespGlobalRuleDetail']>( - API_GLOBAL_RULES, - data +export const putGlobalRuleReq = (data: A6Type['GlobalRulePut']) => { + const { id, ...rest } = data; + return req.put<A6Type['GlobalRulePut'], A6Type['RespGlobalRuleDetail']>( + `${API_GLOBAL_RULES}/${id}`, + rest ); +}; + +export const getGlobalRuleQueryOptions = (id: string) => + queryOptions({ + queryKey: ['plugin-global-rule', id], Review Comment: done. -- 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