mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 20:12:08 +01:00
feat: complete development environment setup and code quality improvements
- Set up pre-commit hooks with husky and lint-staged for automated code quality - Improved TypeScript type safety by replacing 'any' types with proper generics - Fixed markdown linting violations (MD030 spacing) across all documentation - Fixed compound adjective hyphenation in technical documentation - Fixed invalid JSON union syntax in API documentation examples - Automated code formatting and linting on commit - Enhanced error handling with better type constraints - Configured biome and markdownlint for consistent code style - All changes verified with successful production build
This commit is contained in:
@ -232,14 +232,14 @@ function useCompanyData(
|
||||
} else {
|
||||
const errorText = await response.text();
|
||||
const errorMessage = `Failed to load company data (${response.status}: ${response.statusText})`;
|
||||
|
||||
|
||||
console.error("Failed to fetch company - HTTP Error:", {
|
||||
status: response.status,
|
||||
statusText: response.statusText,
|
||||
response: errorText,
|
||||
url: response.url,
|
||||
});
|
||||
|
||||
|
||||
toast({
|
||||
title: "Error",
|
||||
description: errorMessage,
|
||||
@ -247,17 +247,18 @@ function useCompanyData(
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
||||
|
||||
const errorMessage =
|
||||
error instanceof Error ? error.message : "Unknown error occurred";
|
||||
|
||||
console.error("Failed to fetch company - Network/Parse Error:", {
|
||||
message: errorMessage,
|
||||
error: error,
|
||||
stack: error instanceof Error ? error.stack : undefined,
|
||||
url: `/api/platform/companies/${params.id}`,
|
||||
});
|
||||
|
||||
|
||||
toast({
|
||||
title: "Error",
|
||||
title: "Error",
|
||||
description: `Failed to load company data: ${errorMessage}`,
|
||||
variant: "destructive",
|
||||
});
|
||||
@ -371,12 +372,13 @@ function renderCompanyInfoCard(
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
const parsedValue = Number.parseInt(value, 10);
|
||||
|
||||
|
||||
// Validate input: must be a positive number
|
||||
const maxUsers = !Number.isNaN(parsedValue) && parsedValue > 0
|
||||
? parsedValue
|
||||
: 1; // Default to 1 for invalid/negative values
|
||||
|
||||
const maxUsers =
|
||||
!Number.isNaN(parsedValue) && parsedValue > 0
|
||||
? parsedValue
|
||||
: 1; // Default to 1 for invalid/negative values
|
||||
|
||||
state.setEditData((prev) => ({
|
||||
...prev,
|
||||
maxUsers,
|
||||
|
||||
Reference in New Issue
Block a user