From 8287bdeedc29fbc5ae612ce87ae240978aafe48f Mon Sep 17 00:00:00 2001 From: SebClem Date: Thu, 11 Jul 2024 17:07:32 +0200 Subject: [PATCH] Fix compilation errors --- nextcloud_backup/backend/src/routes/config.ts | 6 +++--- nextcloud_backup/backend/tsconfig.json | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/nextcloud_backup/backend/src/routes/config.ts b/nextcloud_backup/backend/src/routes/config.ts index 5922d71..bedf674 100644 --- a/nextcloud_backup/backend/src/routes/config.ts +++ b/nextcloud_backup/backend/src/routes/config.ts @@ -11,7 +11,7 @@ import { } from "../services/webdavConfigService.js"; import { checkWebdavLogin } from "../services/webdavService.js"; import type { BackupConfig } from "../types/services/backupConfig.js"; -import { ValidationError } from "joi"; +import type { ValidationError } from "joi"; import type { WebdavConfig } from "../types/services/webdavConfig.js"; const configRouter = express.Router(); @@ -47,9 +47,9 @@ configRouter.put("/webdav", (req, res) => { res.status(204); res.send(); }) - .catch((error) => { + .catch((error: ValidationError) => { res.status(400); - if (error instanceof ValidationError) { + if (error.details) { res.json(error.details); } else { res.json(error); diff --git a/nextcloud_backup/backend/tsconfig.json b/nextcloud_backup/backend/tsconfig.json index f6fcd62..d5515f0 100644 --- a/nextcloud_backup/backend/tsconfig.json +++ b/nextcloud_backup/backend/tsconfig.json @@ -3,12 +3,12 @@ "compilerOptions": { "allowJs": true, "outDir": "./dist", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "target": "es6", + "module": "nodenext", + "moduleResolution": "nodenext", + "target": "ES2022", "sourceMap": true, "verbatimModuleSyntax": true, - "strict": true, + "strict": true }, "include": ["src/**/*"] -} \ No newline at end of file +}