This commit is contained in:
Andras Bacsai
2021-06-07 21:33:11 +02:00
committed by GitHub
parent 9c173d1de0
commit 31b3f58b2c
36 changed files with 1480 additions and 1999 deletions

View File

@@ -1,5 +1,5 @@
<script>
import { application, initialApplication, initConf, dashboard } from '$store';
import { application, initialApplication, initConf, dashboard, prApplication } from '$store';
import { onDestroy } from 'svelte';
import Loading from '$components/Loading.svelte';
import Navbar from '$components/Application/Navbar.svelte';
@@ -14,15 +14,16 @@
async function setConfiguration() {
try {
const config = await request(`/api/v1/application/config`, $session, {
const { configuration } = await request(`/api/v1/application/config`, $session, {
body: {
name: $application.repository.name,
organization: $application.repository.organization,
branch: $application.repository.branch
}
});
$application = { ...config };
$initConf = JSON.parse(JSON.stringify($application));
$prApplication = configuration.filter((c) => c.general.pullRequest !== 0);
$application = configuration.find((c) => c.general.pullRequest === 0);
if (!$application) browser && goto('/dashboard/applications');
} catch (error) {
browser && goto('/dashboard/applications');
}