mirror of
https://github.com/vcscsvcscs/GenerationsHeritage.git
synced 2025-08-12 13:59:08 +02:00
fixup person create
This commit is contained in:
@@ -332,8 +332,32 @@
|
||||
adminMenu = false;
|
||||
}}
|
||||
editProfile={(id: number) => {
|
||||
openPersonPanel = true;
|
||||
selectedPerson = { id: String(id) };
|
||||
fetch('/api/person/' + id, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.ok) {
|
||||
return response.json() as Promise<components['schemas']['Person']>;
|
||||
} else {
|
||||
alert('Error fetching person data');
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.then((data) => {
|
||||
if (data) {
|
||||
selectedPerson = data.Props as components['schemas']['PersonProperties'] & {
|
||||
id: string | undefined;
|
||||
};
|
||||
selectedPerson.id = String(id);
|
||||
openPersonPanel = true;
|
||||
}else {
|
||||
alert('Error fetching person data');
|
||||
}
|
||||
});
|
||||
}}
|
||||
onChange={() => {}}
|
||||
/>
|
||||
|
Reference in New Issue
Block a user