remove build artifacts that should not be checked in
This commit is contained in:
parent
f4be03ceba
commit
3cb21bf5cf
102 changed files with 461 additions and 424 deletions
|
|
@ -17,7 +17,10 @@
|
|||
|
||||
async function loadUsers(name: string) {
|
||||
try {
|
||||
const res = await fetch(`/api/domains/${encodeURIComponent(name)}/users`);
|
||||
const token = localStorage.getItem('token');
|
||||
const res = await fetch(`/api/domains/${encodeURIComponent(name)}/users`, {
|
||||
headers: { Authorization: `Bearer ${token}` }
|
||||
});
|
||||
if (res.ok) {
|
||||
const data = await res.json();
|
||||
users = data.data || [];
|
||||
|
|
@ -31,9 +34,13 @@
|
|||
|
||||
async function createUser() {
|
||||
try {
|
||||
const token = localStorage.getItem('token');
|
||||
const res = await fetch(`/api/domains/${encodeURIComponent(domainName)}/users`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${token}`
|
||||
},
|
||||
body: JSON.stringify(newUser)
|
||||
});
|
||||
if (res.ok) {
|
||||
|
|
@ -52,7 +59,11 @@
|
|||
async function deleteUser(id: number) {
|
||||
if (!confirm('Delete this user? Mailbox will NOT be deleted.')) return;
|
||||
try {
|
||||
await fetch(`/api/domains/${encodeURIComponent(domainName)}/users/${id}`, { method: 'DELETE' });
|
||||
const token = localStorage.getItem('token');
|
||||
await fetch(`/api/domains/${encodeURIComponent(domainName)}/users/${id}`, {
|
||||
method: 'DELETE',
|
||||
headers: { Authorization: `Bearer ${token}` }
|
||||
});
|
||||
await loadUsers(domainName);
|
||||
} catch (e) {
|
||||
console.error('Failed to delete user:', e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue