mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
cleanup.
This commit is contained in:
@@ -2,10 +2,26 @@ import { redirect } from '@sveltejs/kit';
|
||||
import { base } from '$app/paths';
|
||||
import type { LayoutLoad } from './$types';
|
||||
|
||||
export const load: LayoutLoad = async ({ parent }) => {
|
||||
export const load: LayoutLoad = async ({ parent, url }) => {
|
||||
const { account } = await parent();
|
||||
|
||||
if (!account) {
|
||||
redirect(303, base);
|
||||
const projectId = url.searchParams.get('projectId');
|
||||
const repositoryId = url.searchParams.get('repositoryId');
|
||||
const installationId = url.searchParams.get('installationId');
|
||||
const providerPullRequestId = url.searchParams.get('providerPullRequestId');
|
||||
|
||||
if (!installationId || !repositoryId || !providerPullRequestId) {
|
||||
redirect(303, `${base}`);
|
||||
}
|
||||
|
||||
if (!account) {
|
||||
redirect(303, `${base}`);
|
||||
}
|
||||
|
||||
return {
|
||||
projectId,
|
||||
repositoryId,
|
||||
installationId,
|
||||
providerPullRequestId
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/state';
|
||||
import { app } from '$lib/stores/app';
|
||||
import AppwriteLogoDark from '$lib/images/appwrite-logo-dark.svg';
|
||||
import AppwriteLogoLight from '$lib/images/appwrite-logo-light.svg';
|
||||
@@ -7,6 +6,8 @@
|
||||
import { onMount } from 'svelte';
|
||||
import { getApiEndpoint } from '$lib/stores/sdk';
|
||||
|
||||
export let data;
|
||||
|
||||
const endpoint = getApiEndpoint();
|
||||
const client = new Client();
|
||||
const vcs = new Vcs(client);
|
||||
@@ -15,17 +16,16 @@
|
||||
let repositoryId: string;
|
||||
let providerPullRequestId: string;
|
||||
|
||||
let loading = false;
|
||||
let error = '';
|
||||
let success = '';
|
||||
let loading = false;
|
||||
|
||||
onMount(async () => {
|
||||
const projectId = page.url.searchParams.get('projectId');
|
||||
client.setEndpoint(endpoint).setProject(projectId).setMode('admin');
|
||||
repositoryId = data.repositoryId;
|
||||
installationId = data.installationId;
|
||||
providerPullRequestId = data.providerPullRequestId;
|
||||
|
||||
installationId = page.url.searchParams.get('installationId');
|
||||
repositoryId = page.url.searchParams.get('repositoryId');
|
||||
providerPullRequestId = page.url.searchParams.get('providerPullRequestId') + '';
|
||||
client.setEndpoint(endpoint).setProject(data.projectId).setMode('admin');
|
||||
});
|
||||
|
||||
async function approveDeployment() {
|
||||
|
||||
Reference in New Issue
Block a user