Portfolio/frontend/src/lib/components/dashboard/PortfolioLetterUploadCard.svelte
2022-12-04 21:29:10 +01:00

23 lines
682 B
Svelte

<script lang="ts">
import type { AxiosProgressEvent } from "axios";
import { fetchSubmProgress } from "../../../stores/portfolio";
import { apiUploadPortfolioLetter } from "../../../@api/candidate";
import DashboardUploadCard from "./DashboardUploadCard.svelte";
const onFileDrop = async (file: File) => {
await apiUploadPortfolioLetter(file, (progressEvent: AxiosProgressEvent) => {
console.log(progressEvent.loaded)
});
await fetchSubmProgress();
}
</script>
<DashboardUploadCard
on:filedrop={e => onFileDrop(e.detail)}
title="Portfolio"
filetype="PDF"
filesize="10 MB"
fileType={2}>
</DashboardUploadCard>