Now with new button toggles and edit for JSON data!
This commit is contained in:
@@ -125,16 +125,21 @@ let person_id_random_li: string[] = [];
|
||||
type="button"
|
||||
on:click={async () => {
|
||||
console.log('Add Person');
|
||||
if (!confirm(`Add a new person to the account?\n${$ae_loc.account_name}\nID: ${$slct.account_id}`)) {
|
||||
return;
|
||||
}
|
||||
|
||||
let person_data = {
|
||||
account_id_random: $slct.account_id,
|
||||
// user_id_random: user_obj.user_id_random,
|
||||
source_code: 'manual:SK',
|
||||
source_code: 'manual:SK-core',
|
||||
given_name: 'New',
|
||||
family_name: 'Person',
|
||||
professional_title: 'Temp Prof Title',
|
||||
affiliations: 'Temp Org',
|
||||
primary_email: 'tmp+person@oneskyit.com',
|
||||
// professional_title: 'Temp Prof Title',
|
||||
// affiliations: 'Temp Org',
|
||||
// primary_email: 'tmp+person@oneskyit.com',
|
||||
// allow_auth_key: false,
|
||||
auth_key: Math.floor(Math.random() * 90000000) + 10000000,
|
||||
// Random number between 100000 and 999999
|
||||
passcode: Math.floor(Math.random() * 900000) + 100000,
|
||||
enable: true,
|
||||
@@ -149,10 +154,9 @@ let person_id_random_li: string[] = [];
|
||||
|
||||
console.log('new_person_obj:', new_person_obj);
|
||||
|
||||
if (confirm(`Person created: ${new_person_obj.full_name} (${new_person_obj.primary_email})`)) {
|
||||
if (confirm(`Person created:\n${new_person_obj.full_name} (${new_person_obj.primary_email ?? 'no email'})\nID: ${new_person_obj.person_id_random}\n\nView this person?`)) {
|
||||
// window.location.reload();
|
||||
// invalidateAll();
|
||||
// goto(`/core/person/${new_person_obj.person_id_random}`);
|
||||
goto(`/core/person/${new_person_obj.person_id_random}`, { replaceState: true });
|
||||
// pushState(`/core/person/${new_person_obj.person_id_random}`, { replace: true });
|
||||
// replaceState(`/core/person/${new_person_obj.person_id_random}`);
|
||||
|
||||
Reference in New Issue
Block a user