Skip to content

Commit 029c57d

Browse files
committed
svelte 5
1 parent 92716d2 commit 029c57d

File tree

1 file changed

+8
-16
lines changed
  • src/routes/(authenticated)/git/authorize-contributor

1 file changed

+8
-16
lines changed

src/routes/(authenticated)/git/authorize-contributor/+page.svelte

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,17 @@
55
import { Badge, Layout, Typography } from '@appwrite.io/pink-svelte';
66
import { Button } from '$lib/elements/forms';
77
8-
export let data;
8+
const { data } = $props();
99
1010
const endpoint = getApiEndpoint();
1111
const client = new Client();
1212
const vcs = new Vcs(client);
1313
14-
let installationId: string;
15-
let repositoryId: string;
16-
let providerPullRequestId: string;
17-
18-
let error = '';
19-
let success = '';
20-
let loading = false;
14+
let error = $state('');
15+
let success = $state('');
16+
let loading = $state(false);
2117
2218
onMount(async () => {
23-
repositoryId = data.repositoryId;
24-
installationId = data.installationId;
25-
providerPullRequestId = data.providerPullRequestId;
26-
2719
client.setEndpoint(endpoint).setProject(data.projectId).setMode('admin');
2820
});
2921
@@ -38,9 +30,9 @@
3830
3931
try {
4032
await vcs.updateExternalDeployments({
41-
installationId,
42-
repositoryId,
43-
providerPullRequestId
33+
installationId: data.installationId,
34+
repositoryId: data.repositoryId,
35+
providerPullRequestId: data.providerPullRequestId
4436
});
4537
success = 'Deployment approved successfully! Build will start soon.';
4638
} catch (e) {
@@ -58,7 +50,7 @@
5850
<Badge type="error" variant="secondary" content={error} />
5951
{/if}
6052
<Typography.Title size="l" align="center">
61-
The deployment for pull request #{providerPullRequestId}
53+
The deployment for pull request #{data.providerPullRequestId}
6254
is awaiting approval. When authorized, deployments will be started.
6355
</Typography.Title>
6456
<Button on:click={approveDeployment} secondary>Approve Deployment</Button>

0 commit comments

Comments
 (0)