upgrade dependencies and fix compatibility issues
This commit is contained in:
@@ -68,9 +68,9 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
res.status(405).json({ error: "Method not allowed" })
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error('Users API error:', error)
|
||||
if (error.code === 'SQLITE_CONSTRAINT_UNIQUE') {
|
||||
if (error?.code === 'SQLITE_CONSTRAINT_UNIQUE') {
|
||||
res.status(400).json({ error: "User already exists" })
|
||||
} else {
|
||||
res.status(500).json({ error: "Operation failed" })
|
||||
|
||||
Reference in New Issue
Block a user