mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Type selectedScopes as Scopes[] instead of casting at call site
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
17aba0a3ae
commit
5581e9cca5
+2
-2
@@ -68,7 +68,7 @@
|
||||
let showConfig = false;
|
||||
let silentMode = false;
|
||||
let entrypoint = '';
|
||||
let selectedScopes: string[] = [];
|
||||
let selectedScopes: Scopes[] = [];
|
||||
let execute = true;
|
||||
let variables: Partial<Models.TemplateVariable>[] = [];
|
||||
let specification = specificationOptions[0]?.value || '';
|
||||
@@ -146,7 +146,7 @@
|
||||
timeout: data.template.timeout || undefined,
|
||||
entrypoint: entrypoint || rt?.entrypoint || undefined,
|
||||
commands: rt?.commands || undefined,
|
||||
scopes: selectedScopes?.length ? (selectedScopes as Scopes[]) : undefined,
|
||||
scopes: selectedScopes?.length ? selectedScopes : undefined,
|
||||
installationId:
|
||||
connectBehaviour === 'later' ? undefined : $installation?.$id,
|
||||
providerRepositoryId:
|
||||
|
||||
+4
-3
@@ -1,15 +1,16 @@
|
||||
<script lang="ts">
|
||||
import { scopes } from '$lib/constants';
|
||||
import { Fieldset, Layout, Selector } from '@appwrite.io/pink-svelte';
|
||||
import type { Scopes } from '@appwrite.io/console';
|
||||
|
||||
export let templateScopes: string[];
|
||||
export let selectedScopes: string[];
|
||||
export let selectedScopes: Scopes[];
|
||||
export let execute = true;
|
||||
|
||||
let scopeList = scopes
|
||||
.filter((s) => templateScopes.includes(s.scope))
|
||||
.map((s) => {
|
||||
selectedScopes.push(s.scope);
|
||||
selectedScopes.push(s.scope as Scopes);
|
||||
return {
|
||||
value: s,
|
||||
checked: true
|
||||
@@ -37,7 +38,7 @@
|
||||
on:change={() => {
|
||||
selectedScopes = scopeList
|
||||
.filter((s) => s.checked)
|
||||
.map((s) => s.value.scope);
|
||||
.map((s) => s.value.scope as Scopes);
|
||||
}}>
|
||||
</Selector.Switch>
|
||||
{/each}
|
||||
|
||||
Reference in New Issue
Block a user