Fix build errors: useCallback syntax and API module check
This commit is contained in:
@@ -78,8 +78,8 @@ app.use((err: Error, req: Request, res: Response, next: NextFunction) => {
|
||||
});
|
||||
});
|
||||
|
||||
// Start server
|
||||
if (require.main === module) {
|
||||
// Start server (only if running directly, not when imported)
|
||||
if (typeof require !== 'undefined' && require.main === module) {
|
||||
app.listen(PORT, () => {
|
||||
logger.info(`API server started on port ${PORT}`);
|
||||
});
|
||||
|
||||
@@ -35,7 +35,7 @@ export default function TransactionsPage() {
|
||||
|
||||
const converter = getDefaultConverter();
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
const handleSubmit = useCallback(async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
setErrors({});
|
||||
setIsProcessing(true);
|
||||
|
||||
Reference in New Issue
Block a user