feat: Enhance provider components with detailed documentation and comments
- Added comprehensive comments and JSDoc-style documentation to NotificationProvider, ThemeProvider, UserProvider, and WebsiteThemeProvider for better clarity and maintainability. - Improved type definitions in index.ts for better code understanding and usage. - Introduced Docker support with Dockerfiles for various services including AI server, signaling server, and browser-use service. - Created a docker-compose.yml file to orchestrate multiple services including PostgreSQL, AI, scraper, and frontend. - Added a startup guide (startup.txt) for setting up the CRM environment on Ubuntu with Docker. - Included a .dockerignore file to exclude unnecessary files from Docker builds.
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
// ── Settings: Company ───────────────────────────────────────────────────────
|
||||
// GET /api/settings/company — Get company-wide settings
|
||||
// PATCH /api/settings/company — Update company settings
|
||||
//
|
||||
// Auth: admin/super_admin only
|
||||
// Falls back to sensible defaults if no row exists in company_settings.
|
||||
|
||||
import { NextRequest, NextResponse } from "next/server"
|
||||
import { getSessionUser } from "@/lib/auth"
|
||||
import { query } from "@/lib/db"
|
||||
|
||||
// ── GET ──────────────────────────────────────────────────────────────────────
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const user = await getSessionUser()
|
||||
@@ -36,6 +45,8 @@ export async function GET() {
|
||||
}
|
||||
}
|
||||
|
||||
// ── PATCH ────────────────────────────────────────────────────────────────────
|
||||
|
||||
export async function PATCH(request: NextRequest) {
|
||||
try {
|
||||
const user = await getSessionUser()
|
||||
@@ -46,6 +57,7 @@ export async function PATCH(request: NextRequest) {
|
||||
|
||||
const body = await request.json()
|
||||
|
||||
// Attempt update on existing row; if no row exists, insert one
|
||||
const result = await query(
|
||||
`UPDATE company_settings SET
|
||||
company_name = $1, company_email = $2, company_phone = $3,
|
||||
|
||||
Reference in New Issue
Block a user