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

@ -4,6 +4,10 @@ import { useState, useEffect } from "react";
import { useSession } from "next-auth/react";
import { Company } from "../../../lib/types";
interface CompanyConfigResponse {
company: Company;
}
export default function CompanySettingsPage() {
const { data: session, status } = useSession();
// We store the full company object for future use and updates after save operations
@ -22,7 +26,7 @@ export default function CompanySettingsPage() {
setLoading(true);
try {
const res = await fetch("/api/dashboard/config");
const data = await res.json();
const data = (await res.json()) as CompanyConfigResponse;
setCompany(data.company);
setCsvUrl(data.company.csvUrl || "");
setCsvUsername(data.company.csvUsername || "");
@ -58,10 +62,10 @@ export default function CompanySettingsPage() {
if (res.ok) {
setMessage("Settings saved successfully!");
// Update local state if needed
const data = await res.json();
const data = (await res.json()) as CompanyConfigResponse;
setCompany(data.company);
} else {
const error = await res.json();
const error = (await res.json()) as { message?: string; };
setMessage(
`Failed to save settings: ${error.message || "Unknown error"}`
);