feat: Stop preview deployment

This commit is contained in:
Andras Bacsai
2022-07-26 13:26:12 +00:00
parent 4b37e84466
commit c53acbcd95
5 changed files with 46 additions and 3 deletions

View File

@@ -39,6 +39,16 @@
const data = await get(`/applications/${id}/secrets`);
PRMRSecrets = [...data.secrets];
}
async function removeApplication(container: any) {
try {
await post(`/applications/${id}/stop/preview`, {
pullmergeRequestId: container.pullmergeRequestId
});
toast.push('Preview stopped.');
} catch (error) {
return errorNotification(error);
}
}
async function redeploy(container: any) {
try {
const { buildId } = await post(`/applications/${id}/deploy`, {
@@ -181,6 +191,12 @@
>{$t('application.preview.redeploy')}</button
>
</div>
<div class="flex items-center justify-center">
<button
class="bg-coollabs hover:bg-coollabs-100"
on:click={() => removeApplication(container)}>Remove Application</button
>
</div>
{/each}
{:else}
<div class="flex-col">