mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-24 12:35:31 +00:00
feat: reset password
This commit is contained in:
parent
85e83bd964
commit
e9e6eda7e0
2 changed files with 17 additions and 6 deletions
|
|
@ -3,15 +3,21 @@
|
|||
import type { CandidateData } from "$lib/stores/candidate";
|
||||
import ListElement from "./ListElement.svelte";
|
||||
|
||||
export let id: number;
|
||||
export let candidate: CandidateData;
|
||||
|
||||
async function resetCandidatePassword(id: number) {
|
||||
async function resetCandidatePassword() {
|
||||
try {
|
||||
await apiResetCandidatePassword(id);
|
||||
const res = await apiResetCandidatePassword(id);
|
||||
alert("Nove heslo: " + res.password);
|
||||
} catch {
|
||||
console.log('error');
|
||||
}
|
||||
}
|
||||
|
||||
async function downloadPortfolio() {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="flex flex-row">
|
||||
|
|
@ -35,7 +41,8 @@
|
|||
</div>
|
||||
<div class="ml-20">
|
||||
<div class="bg-sspsBlue hover:bg-sspsBlueDark transition duration-300 rounded-lg px-10 py-4">
|
||||
<button class="text-2xl text-white font-bold">Resetovat heslo</button>
|
||||
<button on:click={e => resetCandidatePassword()} class="text-2xl text-white font-bold">Resetovat heslo</button>
|
||||
<button on:click={e => resetCandidatePassword()} class="text-2xl text-white font-bold">Resetovat heslo</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -94,9 +94,13 @@
|
|||
</td>
|
||||
</tr>
|
||||
{#if candidateDetails.hasOwnProperty(candidate.applicationId)}
|
||||
<CandidateDetails
|
||||
candidate={candidateDetails[candidate.applicationId]}>
|
||||
</CandidateDetails>
|
||||
<div class="mb-20 w-full">
|
||||
<CandidateDetails
|
||||
id={candidate.applicationId}
|
||||
candidate={candidateDetails[candidate.applicationId]}>
|
||||
</CandidateDetails>
|
||||
<hr class="border-4 w-full">
|
||||
</div>
|
||||
{/if}
|
||||
{/each}
|
||||
</tbody>
|
||||
|
|
|
|||
Loading…
Reference in a new issue