Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
b1073ce7b8
commit
542415cccd
1 changed files with 6 additions and 6 deletions
12
server.js
12
server.js
|
@ -51,7 +51,12 @@ try {
|
||||||
|
|
||||||
// Database management methods used by admin routes
|
// Database management methods used by admin routes
|
||||||
addCustomWord: (word, severity, category, createdBy) => Promise.resolve({
|
addCustomWord: (word, severity, category, createdBy) => Promise.resolve({
|
||||||
success: false,
|
id: null,
|
||||||
|
word: word || null,
|
||||||
|
severity: severity || null,
|
||||||
|
category: category || null,
|
||||||
|
createdBy: createdBy || null,
|
||||||
|
success: false,
|
||||||
error: 'Profanity filter not available - please check server configuration'
|
error: 'Profanity filter not available - please check server configuration'
|
||||||
}),
|
}),
|
||||||
removeCustomWord: (wordId) => Promise.resolve({
|
removeCustomWord: (wordId) => Promise.resolve({
|
||||||
|
@ -171,11 +176,6 @@ function setupRoutes() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate profanity filter is properly initialized before setting up routes
|
// Validate profanity filter is properly initialized before setting up routes
|
||||||
if (!profanityFilter) {
|
|
||||||
console.error('CRITICAL ERROR: profanityFilter is undefined after initialization attempt.');
|
|
||||||
console.error('Cannot start server without a functional profanity filter.');
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize routes after everything is set up
|
// Initialize routes after everything is set up
|
||||||
setupRoutes();
|
setupRoutes();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue