mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-18 15:57:31 -03:00
podia llegar un null
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
usuario: UserResponseDto;
|
usuario: UserResponseDto | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { open = $bindable(), usuario }: Props = $props();
|
let { open = $bindable(), usuario }: Props = $props();
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
try {
|
try {
|
||||||
const req = await fetch(`${$apiBase}/api/admin/give`, {
|
const req = await fetch(`${$apiBase}/api/admin/give`, {
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
body: JSON.stringify({ isAdmin: usuario.isAdmin, id: usuario.id }),
|
body: JSON.stringify({ isAdmin: usuario?.isAdmin || false, id: usuario?.id || '' }),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
Authorization: `Bearer ${$sesionStore?.accessToken}`
|
Authorization: `Bearer ${$sesionStore?.accessToken}`
|
||||||
|
|||||||
Reference in New Issue
Block a user