Filtern nach ID
This commit is contained in:
34
src/modules/ImpersonateUserModule.svelte
Normal file
34
src/modules/ImpersonateUserModule.svelte
Normal file
@@ -0,0 +1,34 @@
|
||||
<script lang="ts">
|
||||
import { API_ACCESS_TOKEN_COOKIE_NAME } from "#lib/constants.js";
|
||||
import { api } from "astro-typesafe-api/client";
|
||||
import Cookies from "js-cookie";
|
||||
|
||||
$: userRequest = api.user.GET.fetch({
|
||||
email,
|
||||
take: 25
|
||||
}, {
|
||||
headers: {
|
||||
"Authorization": `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`
|
||||
}
|
||||
})
|
||||
|
||||
let email: string = "";
|
||||
</script>
|
||||
|
||||
<input type="email" bind:value={email}>
|
||||
|
||||
{#await userRequest}
|
||||
|
||||
{:then users}
|
||||
<div class="flex flex-col gap-2 my-2">
|
||||
{#each users as user}
|
||||
<div class="flex flex-row justify-between border p-2 rounded-sm">
|
||||
<div class="flex flex-col">
|
||||
<span>{user.vorname} {user.name}</span>
|
||||
<span class="text-xs">{user.email}</span>
|
||||
</div>
|
||||
<a href="/dashboard/admin/impersonate?uid={user.uid}" class="button text-sm">Einloggen</a>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
{/await}
|
||||
Reference in New Issue
Block a user