mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-06 00:01:41 +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 type { CandidateData } from "$lib/stores/candidate";
|
||||||
import ListElement from "./ListElement.svelte";
|
import ListElement from "./ListElement.svelte";
|
||||||
|
|
||||||
|
export let id: number;
|
||||||
export let candidate: CandidateData;
|
export let candidate: CandidateData;
|
||||||
|
|
||||||
async function resetCandidatePassword(id: number) {
|
async function resetCandidatePassword() {
|
||||||
try {
|
try {
|
||||||
await apiResetCandidatePassword(id);
|
const res = await apiResetCandidatePassword(id);
|
||||||
|
alert("Nove heslo: " + res.password);
|
||||||
} catch {
|
} catch {
|
||||||
console.log('error');
|
console.log('error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function downloadPortfolio() {
|
||||||
|
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-row">
|
<div class="flex flex-row">
|
||||||
|
|
@ -35,7 +41,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="ml-20">
|
<div class="ml-20">
|
||||||
<div class="bg-sspsBlue hover:bg-sspsBlueDark transition duration-300 rounded-lg px-10 py-4">
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -94,9 +94,13 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{#if candidateDetails.hasOwnProperty(candidate.applicationId)}
|
{#if candidateDetails.hasOwnProperty(candidate.applicationId)}
|
||||||
<CandidateDetails
|
<div class="mb-20 w-full">
|
||||||
candidate={candidateDetails[candidate.applicationId]}>
|
<CandidateDetails
|
||||||
</CandidateDetails>
|
id={candidate.applicationId}
|
||||||
|
candidate={candidateDetails[candidate.applicationId]}>
|
||||||
|
</CandidateDetails>
|
||||||
|
<hr class="border-4 w-full">
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue