larxius commited on
Commit
15dc201
·
verified ·
1 Parent(s): 122d3d1

Update frontend/src/pages/SuperAdminPanel.jsx

Browse files
frontend/src/pages/SuperAdminPanel.jsx CHANGED
@@ -535,13 +535,13 @@ const SuperAdminPanel = () => {
535
  };
536
 
537
  const handleProvisionTenant = () => {
538
- setPromptValues({ tier: 'quick', name: '' });
539
  setPromptModal({
540
  isOpen: true,
541
  title: 'Add New Organization',
542
  desc: 'Create a new tenant organization.',
543
  inputs: [
544
- { key: 'name', label: 'Organization Name', placeholder: 'Enter name...' },
545
  {
546
  key: 'tier',
547
  label: 'Subscription Tier',
@@ -552,14 +552,15 @@ const SuperAdminPanel = () => {
552
  { label: 'Deep', value: 'deep' },
553
  { label: 'Enterprise(Custom)', value: 'Enterprise(Custom)' }
554
  ]
555
- }
 
556
  ],
557
  onConfirm: async (values) => {
558
  try {
559
  const res = await fetch('/api/auth/organizations', {
560
  method: 'POST',
561
  headers: { 'Authorization': `Bearer ${localStorage.getItem('wss_token')}`, 'Content-Type': 'application/json' },
562
- body: JSON.stringify({ name: values.name, tier: values.tier })
563
  });
564
  if (res.ok) {
565
  toast.success('Organization created successfully');
 
535
  };
536
 
537
  const handleProvisionTenant = () => {
538
+ setPromptValues({ tier: 'quick', name: '', admin_email: '' });
539
  setPromptModal({
540
  isOpen: true,
541
  title: 'Add New Organization',
542
  desc: 'Create a new tenant organization.',
543
  inputs: [
544
+ { key: 'name', label: 'Organization Name', placeholder: 'Enter organization name...' },
545
  {
546
  key: 'tier',
547
  label: 'Subscription Tier',
 
552
  { label: 'Deep', value: 'deep' },
553
  { label: 'Enterprise(Custom)', value: 'Enterprise(Custom)' }
554
  ]
555
+ },
556
+ { key: 'admin_email', label: 'Admin Email (Optional)', placeholder: 'admin@company.com' }
557
  ],
558
  onConfirm: async (values) => {
559
  try {
560
  const res = await fetch('/api/auth/organizations', {
561
  method: 'POST',
562
  headers: { 'Authorization': `Bearer ${localStorage.getItem('wss_token')}`, 'Content-Type': 'application/json' },
563
+ body: JSON.stringify({ name: values.name, tier: values.tier, admin_email: values.admin_email })
564
  });
565
  if (res.ok) {
566
  toast.success('Organization created successfully');