Merge pull request #78 from EETagent/frontend_cache_delete

(frontend) cache delete
This commit is contained in:
Vojtěch Jungmann 2022-12-06 00:20:16 +01:00 committed by GitHub
commit db8df8f87a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 6 deletions

View file

@ -39,7 +39,7 @@ impl Fairing for CORS {
));
response.set_header(Header::new(
"Access-Control-Allow-Methods",
"POST, GET, OPTIONS",
"POST, GET, OPTIONS, DELETE",
));
response.set_header(Header::new("Access-Control-Allow-Headers", "content-type"));
response.set_header(Header::new("Access-Control-Allow-Credentials", "true"));

View file

@ -1,6 +1,6 @@
<script lang="ts">
import { fetchSubmProgress } from '$lib/stores/portfolio';
import { apiUploadCoverLetter } from '$lib/@api/candidate';
import { apiDeleteCoverLetter, apiUploadCoverLetter } from '$lib/@api/candidate';
import DashboardUploadCard from './DashboardUploadCard.svelte';
const onFileDrop = async (detail: any) => {
@ -9,10 +9,16 @@
await apiUploadCoverLetter(file, callback);
await fetchSubmProgress();
};
const onDelete = async () => {
await apiDeleteCoverLetter();
await fetchSubmProgress();
};
</script>
<DashboardUploadCard
on:filedrop={(e) => onFileDrop(e.detail)}
on:delete={onDelete}
title="Motivační dopis"
filetype="PDF"
filesize={10}

View file

@ -101,7 +101,13 @@
<div class="mb-4 mt-1 sm:mb-0 sm:mt-0">
<FileType {filetype} filesize={filesize + ' MB'} />
</div>
<div class="absolute right-0 top-4 px-7">
<div class="absolute right-0 top-4 flex items-center px-7">
{#if status === 'uploaded'}
<button
class="mr-3 rounded-xl bg-[#ef8b46] py-0.5 px-2 text-white shadow-md transition-all duration-300 hover:bg-orange-400"
on:click={() => dispatch('delete')}>Smazat</button
>
{/if}
<StatusNotificationDot {status} />
</div>
</div>

View file

@ -1,6 +1,6 @@
<script lang="ts">
import { fetchSubmProgress } from '$lib/stores/portfolio';
import { apiUploadPortfolioLetter } from '../../@api/candidate';
import { apiDeletePortfolioLetter, apiUploadPortfolioLetter } from '../../@api/candidate';
import DashboardUploadCard from './DashboardUploadCard.svelte';
const onFileDrop = async (detail: any) => {
@ -9,10 +9,16 @@
await apiUploadPortfolioLetter(file, callback);
await fetchSubmProgress();
};
const onDelete = async () => {
await apiDeletePortfolioLetter();
await fetchSubmProgress();
};
</script>
<DashboardUploadCard
on:filedrop={(e) => onFileDrop(e.detail)}
on:delete={onDelete}
title="Portfolio"
filetype="PDF"
filesize={10}

View file

@ -1,6 +1,6 @@
<script lang="ts">
import { fetchSubmProgress } from '$lib/stores/portfolio';
import { apiUploadPortfolioZip } from '$lib/@api/candidate';
import { apiDeletePortfolioZip, apiUploadPortfolioZip } from '$lib/@api/candidate';
import DashboardUploadCard from './DashboardUploadCard.svelte';
const onFileDrop = async (detail: any) => {
@ -9,10 +9,16 @@
await apiUploadPortfolioZip(file, callback);
await fetchSubmProgress();
};
const onDelete = async () => {
await apiDeletePortfolioZip();
await fetchSubmProgress();
};
</script>
<DashboardUploadCard
on:filedrop={(e) => onFileDrop(e.detail)}
on:delete={onDelete}
title="Další data"
filetype="ZIP"
filesize={100}

View file

@ -19,7 +19,7 @@
<!-- make red dot -->
<div class="flex animate-pulse flex-row justify-between div-{status}">
<span class="mt-1 h-6 w-6 rounded-full {status}" />
<span class="h-6 w-6 rounded-full {status}" />
<!-- <h3 class="ml-8 font-bold text-xl">{title}</h3> -->
</div>