Просмотр исходного кода

chore: format code (feat-client-restriction-refactor-c3c48c2)

github-actions[bot] 1 месяц назад
Родитель
Сommit
31e0a01c08

+ 17 - 5
src/app/[locale]/dashboard/_components/user/forms/access-restrictions-section.tsx

@@ -91,18 +91,30 @@ export function AccessRestrictionsSection({
   const handleAllowToggle = (clientValue: string, checked: boolean) => {
     if (checked) {
       onChange("allowedClients", [...allowed.filter((c) => c !== clientValue), clientValue]);
-      onChange("blockedClients", blocked.filter((c) => c !== clientValue));
+      onChange(
+        "blockedClients",
+        blocked.filter((c) => c !== clientValue)
+      );
     } else {
-      onChange("allowedClients", allowed.filter((c) => c !== clientValue));
+      onChange(
+        "allowedClients",
+        allowed.filter((c) => c !== clientValue)
+      );
     }
   };
 
   const handleBlockToggle = (clientValue: string, checked: boolean) => {
     if (checked) {
       onChange("blockedClients", [...blocked.filter((c) => c !== clientValue), clientValue]);
-      onChange("allowedClients", allowed.filter((c) => c !== clientValue));
+      onChange(
+        "allowedClients",
+        allowed.filter((c) => c !== clientValue)
+      );
     } else {
-      onChange("blockedClients", blocked.filter((c) => c !== clientValue));
+      onChange(
+        "blockedClients",
+        blocked.filter((c) => c !== clientValue)
+      );
     }
   };
 
@@ -123,7 +135,7 @@ export function AccessRestrictionsSection({
       if (allowedModels.length >= 50) return false;
       return true;
     },
-    [allowedModels],
+    [allowedModels]
   );
 
   const renderPresetRow = (value: string, indent: boolean) => {

+ 4 - 2
src/repository/provider.ts

@@ -588,8 +588,10 @@ export async function updateProvider(
   if (providerData.model_redirects !== undefined)
     dbData.modelRedirects = providerData.model_redirects;
   if (providerData.allowed_models !== undefined) dbData.allowedModels = providerData.allowed_models;
-  if (providerData.allowed_clients !== undefined) dbData.allowedClients = providerData.allowed_clients ?? [];
-  if (providerData.blocked_clients !== undefined) dbData.blockedClients = providerData.blocked_clients ?? [];
+  if (providerData.allowed_clients !== undefined)
+    dbData.allowedClients = providerData.allowed_clients ?? [];
+  if (providerData.blocked_clients !== undefined)
+    dbData.blockedClients = providerData.blocked_clients ?? [];
   if (providerData.mcp_passthrough_type !== undefined)
     dbData.mcpPassthroughType = providerData.mcp_passthrough_type;
   if (providerData.mcp_passthrough_url !== undefined)