fix(6): fix TypeScript type consistency issues
- Make Item.id required (items from DB always have id) - Use shared Item type from db.ts in QuantityAdjustmentModal - Show full npm build output instead of silencing errors - Ensures all modals use consistent type definitions
This commit is contained in:
@@ -4,16 +4,7 @@ import { useState, useEffect } from 'react';
|
|||||||
import { X } from 'lucide-react';
|
import { X } from 'lucide-react';
|
||||||
import QuantityDisplay from './QuantityDisplay';
|
import QuantityDisplay from './QuantityDisplay';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import { Item } from '@/lib/db';
|
||||||
interface Item {
|
|
||||||
id: number;
|
|
||||||
name: string;
|
|
||||||
quantity: number;
|
|
||||||
part_number?: string;
|
|
||||||
barcode?: string;
|
|
||||||
category?: string;
|
|
||||||
description?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface QuantityAdjustmentModalProps {
|
interface QuantityAdjustmentModalProps {
|
||||||
item: Item | null;
|
item: Item | null;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import Dexie, { Table } from 'dexie';
|
import Dexie, { Table } from 'dexie';
|
||||||
|
|
||||||
export interface Item {
|
export interface Item {
|
||||||
id?: number;
|
id: number;
|
||||||
barcode: string;
|
barcode: string;
|
||||||
name: string;
|
name: string;
|
||||||
category: string;
|
category: string;
|
||||||
|
|||||||
@@ -112,12 +112,13 @@ class StandaloneServerManager:
|
|||||||
# Build if needed
|
# Build if needed
|
||||||
if not (frontend_dir / ".next" / "standalone").exists():
|
if not (frontend_dir / ".next" / "standalone").exists():
|
||||||
self.log("Building Next.js application...")
|
self.log("Building Next.js application...")
|
||||||
subprocess.run(
|
result = subprocess.run(
|
||||||
["npm", "run", "build"],
|
["npm", "run", "build"],
|
||||||
cwd=str(frontend_dir),
|
cwd=str(frontend_dir),
|
||||||
check=True,
|
capture_output=False
|
||||||
capture_output=True
|
|
||||||
)
|
)
|
||||||
|
if result.returncode != 0:
|
||||||
|
self.error(f"Frontend build failed with exit code {result.returncode}")
|
||||||
|
|
||||||
def start_backend(self):
|
def start_backend(self):
|
||||||
"""Start FastAPI backend server using uvicorn from project root"""
|
"""Start FastAPI backend server using uvicorn from project root"""
|
||||||
|
|||||||
Reference in New Issue
Block a user