Add initial wrangler configuration for livedash-node project

- Created wrangler.json with project metadata and settings
- Configured D1 database binding for database interaction
- Enabled observability for monitoring
- Added placeholders for smart placement, environment variables, static assets, and service bindings
This commit is contained in:
2025-06-01 04:51:57 +02:00
parent c9e24298cd
commit 0c18e8be57
21 changed files with 14443 additions and 9721 deletions

View File

@ -9,6 +9,10 @@ interface UserItem {
role: string;
}
interface UsersApiResponse {
users: UserItem[];
}
export default function UserManagementPage() {
const { data: session, status } = useSession();
const [users, setUsers] = useState<UserItem[]>([]);
@ -27,7 +31,7 @@ export default function UserManagementPage() {
setLoading(true);
try {
const res = await fetch("/api/dashboard/users");
const data = await res.json();
const data = (await res.json()) as UsersApiResponse;
setUsers(data.users);
} catch (error) {
console.error("Failed to fetch users:", error);
@ -52,7 +56,7 @@ export default function UserManagementPage() {
// Refresh the user list
fetchUsers();
} else {
const error = await res.json();
const error = (await res.json()) as { message?: string; };
setMessage(
`Failed to invite user: ${error.message || "Unknown error"}`
);