jam411 hace 3 años
padre
commit
deefe060ad

+ 1 - 1
packages/app/src/components/Admin/PluginsExtension/PluginCard.tsx

@@ -31,7 +31,7 @@ export const PluginCard = (props: Props): JSX.Element => {
     const [isEnabled, setState] = useState<boolean>(data.data.isEnabled);
     const [isEnabled, setState] = useState<boolean>(data.data.isEnabled);
 
 
     const onChangeHandler = async() => {
     const onChangeHandler = async() => {
-      const reqUrl = '/plugins-extension/plugin';
+      const reqUrl = '/plugins-extension/switch-isenabled';
 
 
       try {
       try {
         const res = await apiv3Post(reqUrl, { _id: id });
         const res = await apiv3Post(reqUrl, { _id: id });

+ 2 - 2
packages/app/src/server/routes/apiv3/plugins-extension.ts

@@ -38,7 +38,7 @@ module.exports = (crowi: Crowi) => {
     }
     }
   });
   });
 
 
-  router.post('/swrplugin', async(req: any, res: ApiV3Response) => {
+  router.post('/get-isenabled', async(req: any, res: ApiV3Response) => {
     if (pluginService == null) {
     if (pluginService == null) {
       return res.apiv3Err(400);
       return res.apiv3Err(400);
     }
     }
@@ -52,7 +52,7 @@ module.exports = (crowi: Crowi) => {
     }
     }
   });
   });
 
 
-  router.post('/plugin', async(req: any, res: ApiV3Response) => {
+  router.post('/switch-isenabled', async(req: any, res: ApiV3Response) => {
     if (pluginService == null) {
     if (pluginService == null) {
       return res.apiv3Err(400);
       return res.apiv3Err(400);
     }
     }

+ 1 - 1
packages/app/src/stores/plugin.tsx

@@ -24,7 +24,7 @@ export const useSWRxPlugins = (): SWRResponse<any | null, Error> => {
 
 
 const pluginFetcher = (id: string) => {
 const pluginFetcher = (id: string) => {
   return async() => {
   return async() => {
-    const reqUrl = '/plugins-extension/swrplugin';
+    const reqUrl = '/plugins-extension/get-isenabled';
     try {
     try {
       const data = await apiv3Post(reqUrl, { _id: id });
       const data = await apiv3Post(reqUrl, { _id: id });
       return data;
       return data;