|
@@ -4,13 +4,14 @@ import { useTranslation } from 'react-i18next';
|
|
|
|
|
|
|
|
import { toastSuccess, toastError } from '~/client/util/apiNotification';
|
|
import { toastSuccess, toastError } from '~/client/util/apiNotification';
|
|
|
import { apiv3Post } from '~/client/util/apiv3-client';
|
|
import { apiv3Post } from '~/client/util/apiv3-client';
|
|
|
|
|
+import { success } from '~/server/util/apiResponse';
|
|
|
|
|
|
|
|
import AdminInstallButtonRow from '../Common/AdminUpdateButtonRow';
|
|
import AdminInstallButtonRow from '../Common/AdminUpdateButtonRow';
|
|
|
// TODO: error notification (toast, loggerFactory)
|
|
// TODO: error notification (toast, loggerFactory)
|
|
|
// TODO: i18n
|
|
// TODO: i18n
|
|
|
|
|
|
|
|
export const PluginInstallerForm = (): JSX.Element => {
|
|
export const PluginInstallerForm = (): JSX.Element => {
|
|
|
- const { t } = useTranslation('admin');
|
|
|
|
|
|
|
+ // const { t } = useTranslation('admin');
|
|
|
|
|
|
|
|
const submitHandler = useCallback(async(e) => {
|
|
const submitHandler = useCallback(async(e) => {
|
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
@@ -31,13 +32,13 @@ export const PluginInstallerForm = (): JSX.Element => {
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
await apiv3Post('/plugins-extention', { pluginInstallerForm });
|
|
await apiv3Post('/plugins-extention', { pluginInstallerForm });
|
|
|
- toastSuccess(t('toaster.update_successed', { target: t('app_settings') }));
|
|
|
|
|
|
|
+ toastSuccess('Plugin Install Successed!');
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
toastError(err);
|
|
toastError(err);
|
|
|
// logger.error(err);
|
|
// logger.error(err);
|
|
|
}
|
|
}
|
|
|
- }, [t]);
|
|
|
|
|
|
|
+ }, []);
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<form role="form" onSubmit={submitHandler}>
|
|
<form role="form" onSubmit={submitHandler}>
|