🐛 fix(api): Update Model

This commit is contained in:
web@ppanel
2024-12-01 15:44:51 +07:00
parent 81e0f21a39
commit 39aaa73d6d
33 changed files with 1257 additions and 413 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ export default function Site() {
await updateCurrencyConfig({
...data,
[key]: value,
} as API.UpdateCurrencyConfigRequest);
} as API.CurrencyConfig);
toast.success(t('saveSuccess'));
refetch();
} catch (error) {
+1 -1
View File
@@ -31,7 +31,7 @@ export default function Email() {
await updateEmailSmtpConfig({
...data,
[key]: value,
} as API.UpdateEmailSmtpConfigRequest);
} as API.EmailSmtpConfig);
toast.success(t('saveSuccess'));
refetch();
} catch (error) {
+1 -1
View File
@@ -27,7 +27,7 @@ export default function Invite() {
await updateInviteConfig({
...data,
[key]: value,
} as API.UpdateInviteConfigRequest);
} as API.InviteConfig);
toast.success(t('saveSuccess'));
refetch();
} catch (error) {
+1 -1
View File
@@ -28,7 +28,7 @@ export default function Node() {
await updateNodeConfig({
...data,
[key]: value,
} as API.GetNodeConfigResponse);
} as API.NodeConfig);
toast.success(t('saveSuccess'));
refetch();
} catch (error) {
+1 -1
View File
@@ -28,7 +28,7 @@ export default function Register() {
await updateRegisterConfig({
...data,
[key]: value,
} as API.GetRegisterConfigResponse);
} as API.RegisterConfig);
toast.success(t('saveSuccess'));
refetch();
} catch (error) {
@@ -24,8 +24,8 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '@shadcn/ui/tabs';
import { Textarea } from '@shadcn/ui/textarea';
function compareData(
originalData: API.GetApplicationResponse,
modifiedData: API.GetApplicationResponse,
originalData: API.ApplicationResponse,
modifiedData: API.ApplicationResponse,
): {
added: API.Application[];
deleted: API.Application[];
@@ -107,7 +107,7 @@ export default function Subscription() {
await updateSubscribeConfig({
...data,
[key]: value,
} as API.GetSubscribeConfigResponse);
} as API.SubscribeConfig);
toast.success(t('saveSuccess'));
refetch();
} catch (error) {
@@ -123,7 +123,7 @@ export default function Subscription() {
return data.data?.subscribe_types || [];
},
});
const [app, setApp] = useState<API.GetApplicationResponse>();
const [app, setApp] = useState<API.ApplicationResponse>();
const appTypes = Object.keys(apps || {});
useEffect(() => {
@@ -253,7 +253,7 @@ export default function Subscription() {
setApp({
...app,
[type]: newList,
} as API.GetApplicationResponse);
} as API.ApplicationResponse);
};
return (
@@ -300,7 +300,7 @@ export default function Subscription() {
setApp({
...app,
[type]: list.filter((l, i) => i !== index),
} as API.GetApplicationResponse);
} as API.ApplicationResponse);
}}
>
{t('delete')}
@@ -320,7 +320,7 @@ export default function Subscription() {
platform: type,
},
],
} as API.GetApplicationResponse);
} as API.ApplicationResponse);
}}
>
{t('add')}
+1 -1
View File
@@ -27,7 +27,7 @@ export default function Telegram() {
await updateTelegramConfig({
...data,
[key]: value,
} as API.GetTelegramConfigResponse);
} as API.TelegramConfig);
toast.success(t('saveSuccess'));
refetch();
} catch (error) {
+1 -1
View File
@@ -25,7 +25,7 @@ export default function Tos() {
await updateTosConfig({
...data,
[key]: value,
} as API.GetTosConfigResponse);
} as API.TosConfig);
toast.success(t('saveSuccess'));
refetch();
} catch (error) {
+1 -1
View File
@@ -26,7 +26,7 @@ export default function Verify() {
await updateVerifyConfig({
...data,
[key]: value,
} as API.GetVerifyConfigResponse);
} as API.VerifyConfig);
toast.success(t('saveSuccess'));
refetch();
} catch (error) {