From d9b9c9005730197087b624279fc63052266ccc7e Mon Sep 17 00:00:00 2001 From: Jacob Son Date: Sat, 10 Jan 2026 02:26:57 +0100 Subject: [PATCH] Revert "chore(deps): bump next from 14.2.35 to 16.1.1" This reverts commit dfa0f48ca014a1bfb3ea4b3ca8e8bf8d91b951e2. --- package-lock.json | 686 +++++----------------------- package.json | 2 +- src/app/api/documents/[id]/route.ts | 21 +- src/app/api/employees/[id]/route.ts | 23 +- src/app/api/equipment/[id]/route.ts | 25 +- src/app/api/missions/[id]/route.ts | 35 +- src/app/api/species/[id]/route.ts | 21 +- src/app/api/users/[id]/route.ts | 12 +- tsconfig.json | 25 +- 9 files changed, 169 insertions(+), 681 deletions(-) diff --git a/package-lock.json b/package-lock.json index fc4e9c7..fbc4ea3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "leaflet": "^1.9.4", "leaflet.markercluster": "^1.5.3", "lucide-react": "^0.427.0", - "next": "^16.1.1", + "next": "^14.2.0", "next-auth": "^4.24.7", "otplib": "^12.0.1", "papaparse": "^5.4.1", @@ -668,6 +668,7 @@ "version": "1.7.1", "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "dev": true, "license": "MIT", "optional": true, "dependencies": { @@ -1255,472 +1256,6 @@ "dev": true, "license": "BSD-3-Clause" }, - "node_modules/@img/colour": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.0.0.tgz", - "integrity": "sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw==", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/@img/sharp-darwin-arm64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz", - "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==", - "cpu": [ - "arm64" - ], - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-darwin-arm64": "1.2.4" - } - }, - "node_modules/@img/sharp-darwin-x64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz", - "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==", - "cpu": [ - "x64" - ], - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-darwin-x64": "1.2.4" - } - }, - "node_modules/@img/sharp-libvips-darwin-arm64": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz", - "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==", - "cpu": [ - "arm64" - ], - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "darwin" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-darwin-x64": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz", - "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==", - "cpu": [ - "x64" - ], - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "darwin" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-arm": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz", - "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==", - "cpu": [ - "arm" - ], - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-arm64": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz", - "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==", - "cpu": [ - "arm64" - ], - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-ppc64": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz", - "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==", - "cpu": [ - "ppc64" - ], - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-riscv64": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz", - "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==", - "cpu": [ - "riscv64" - ], - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-s390x": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz", - "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==", - "cpu": [ - "s390x" - ], - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-x64": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz", - "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==", - "cpu": [ - "x64" - ], - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linuxmusl-arm64": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz", - "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==", - "cpu": [ - "arm64" - ], - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linuxmusl-x64": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz", - "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==", - "cpu": [ - "x64" - ], - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-linux-arm": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz", - "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==", - "cpu": [ - "arm" - ], - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-arm": "1.2.4" - } - }, - "node_modules/@img/sharp-linux-arm64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz", - "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==", - "cpu": [ - "arm64" - ], - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-arm64": "1.2.4" - } - }, - "node_modules/@img/sharp-linux-ppc64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz", - "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==", - "cpu": [ - "ppc64" - ], - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-ppc64": "1.2.4" - } - }, - "node_modules/@img/sharp-linux-riscv64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz", - "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==", - "cpu": [ - "riscv64" - ], - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-riscv64": "1.2.4" - } - }, - "node_modules/@img/sharp-linux-s390x": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz", - "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==", - "cpu": [ - "s390x" - ], - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-s390x": "1.2.4" - } - }, - "node_modules/@img/sharp-linux-x64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz", - "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==", - "cpu": [ - "x64" - ], - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-x64": "1.2.4" - } - }, - "node_modules/@img/sharp-linuxmusl-arm64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz", - "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==", - "cpu": [ - "arm64" - ], - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-arm64": "1.2.4" - } - }, - "node_modules/@img/sharp-linuxmusl-x64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz", - "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==", - "cpu": [ - "x64" - ], - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-x64": "1.2.4" - } - }, - "node_modules/@img/sharp-wasm32": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz", - "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==", - "cpu": [ - "wasm32" - ], - "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", - "optional": true, - "dependencies": { - "@emnapi/runtime": "^1.7.0" - }, - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-win32-arm64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz", - "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==", - "cpu": [ - "arm64" - ], - "license": "Apache-2.0 AND LGPL-3.0-or-later", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-win32-ia32": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz", - "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==", - "cpu": [ - "ia32" - ], - "license": "Apache-2.0 AND LGPL-3.0-or-later", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-win32-x64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz", - "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==", - "cpu": [ - "x64" - ], - "license": "Apache-2.0 AND LGPL-3.0-or-later", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -1835,9 +1370,9 @@ } }, "node_modules/@next/env": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/@next/env/-/env-16.1.1.tgz", - "integrity": "sha512-3oxyM97Sr2PqiVyMyrZUtrtM3jqqFxOQJVuKclDsgj/L728iZt/GyslkN4NwarledZATCenbk4Offjk1hQmaAA==", + "version": "14.2.35", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.35.tgz", + "integrity": "sha512-DuhvCtj4t9Gwrx80dmz2F4t/zKQ4ktN8WrMwOuVzkJfBilwAwGr6v16M5eI8yCuZ63H9TTuEU09Iu2HqkzFPVQ==", "license": "MIT" }, "node_modules/@next/eslint-plugin-next": { @@ -1851,9 +1386,9 @@ } }, "node_modules/@next/swc-darwin-arm64": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.1.1.tgz", - "integrity": "sha512-JS3m42ifsVSJjSTzh27nW+Igfha3NdBOFScr9C80hHGrWx55pTrVL23RJbqir7k7/15SKlrLHhh/MQzqBBYrQA==", + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.33.tgz", + "integrity": "sha512-HqYnb6pxlsshoSTubdXKu15g3iivcbsMXg4bYpjL2iS/V6aQot+iyF4BUc2qA/J/n55YtvE4PHMKWBKGCF/+wA==", "cpu": [ "arm64" ], @@ -1867,9 +1402,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.1.1.tgz", - "integrity": "sha512-hbyKtrDGUkgkyQi1m1IyD3q4I/3m9ngr+V93z4oKHrPcmxwNL5iMWORvLSGAf2YujL+6HxgVvZuCYZfLfb4bGw==", + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.33.tgz", + "integrity": "sha512-8HGBeAE5rX3jzKvF593XTTFg3gxeU4f+UWnswa6JPhzaR6+zblO5+fjltJWIZc4aUalqTclvN2QtTC37LxvZAA==", "cpu": [ "x64" ], @@ -1883,9 +1418,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.1.1.tgz", - "integrity": "sha512-/fvHet+EYckFvRLQ0jPHJCUI5/B56+2DpI1xDSvi80r/3Ez+Eaa2Yq4tJcRTaB1kqj/HrYKn8Yplm9bNoMJpwQ==", + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.33.tgz", + "integrity": "sha512-JXMBka6lNNmqbkvcTtaX8Gu5by9547bukHQvPoLe9VRBx1gHwzf5tdt4AaezW85HAB3pikcvyqBToRTDA4DeLw==", "cpu": [ "arm64" ], @@ -1899,9 +1434,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.1.1.tgz", - "integrity": "sha512-MFHrgL4TXNQbBPzkKKur4Fb5ICEJa87HM7fczFs2+HWblM7mMLdco3dvyTI+QmLBU9xgns/EeeINSZD6Ar+oLg==", + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.33.tgz", + "integrity": "sha512-Bm+QulsAItD/x6Ih8wGIMfRJy4G73tu1HJsrccPW6AfqdZd0Sfm5Imhgkgq2+kly065rYMnCOxTBvmvFY1BKfg==", "cpu": [ "arm64" ], @@ -1915,9 +1450,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.1.1.tgz", - "integrity": "sha512-20bYDfgOQAPUkkKBnyP9PTuHiJGM7HzNBbuqmD0jiFVZ0aOldz+VnJhbxzjcSabYsnNjMPsE0cyzEudpYxsrUQ==", + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.33.tgz", + "integrity": "sha512-FnFn+ZBgsVMbGDsTqo8zsnRzydvsGV8vfiWwUo1LD8FTmPTdV+otGSWKc4LJec0oSexFnCYVO4hX8P8qQKaSlg==", "cpu": [ "x64" ], @@ -1931,9 +1466,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.1.1.tgz", - "integrity": "sha512-9pRbK3M4asAHQRkwaXwu601oPZHghuSC8IXNENgbBSyImHv/zY4K5udBusgdHkvJ/Tcr96jJwQYOll0qU8+fPA==", + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.33.tgz", + "integrity": "sha512-345tsIWMzoXaQndUTDv1qypDRiebFxGYx9pYkhwY4hBRaOLt8UGfiWKr9FSSHs25dFIf8ZqIFaPdy5MljdoawA==", "cpu": [ "x64" ], @@ -1947,9 +1482,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.1.1.tgz", - "integrity": "sha512-bdfQkggaLgnmYrFkSQfsHfOhk/mCYmjnrbRCGgkMcoOBZ4n+TRRSLmT/CU5SATzlBJ9TpioUyBW/vWFXTqQRiA==", + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.33.tgz", + "integrity": "sha512-nscpt0G6UCTkrT2ppnJnFsYbPDQwmum4GNXYTeoTIdsmMydSKFz9Iny2jpaRupTb+Wl298+Rh82WKzt9LCcqSQ==", "cpu": [ "arm64" ], @@ -1962,10 +1497,26 @@ "node": ">= 10" } }, + "node_modules/@next/swc-win32-ia32-msvc": { + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.33.tgz", + "integrity": "sha512-pc9LpGNKhJ0dXQhZ5QMmYxtARwwmWLpeocFmVG5Z0DzWq5Uf0izcI8tLc+qOpqxO1PWqZ5A7J1blrUIKrIFc7Q==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.1.1.tgz", - "integrity": "sha512-Ncwbw2WJ57Al5OX0k4chM68DKhEPlrXBaSXDCi2kPi5f4d8b3ejr3RRJGfKBLrn2YJL5ezNS7w2TZLHSti8CMw==", + "version": "14.2.33", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.33.tgz", + "integrity": "sha512-nOjfZMy8B94MdisuzZo9/57xuFVLHJaDj5e/xrduJp9CV2/HrfxTRH2fbyLe+K9QT41WBLUd4iXX3R7jBp0EUg==", "cpu": [ "x64" ], @@ -3741,13 +3292,20 @@ "dev": true, "license": "MIT" }, + "node_modules/@swc/counter": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", + "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==", + "license": "Apache-2.0" + }, "node_modules/@swc/helpers": { - "version": "0.5.15", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", - "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.5.tgz", + "integrity": "sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==", "license": "Apache-2.0", "dependencies": { - "tslib": "^2.8.0" + "@swc/counter": "^0.1.3", + "tslib": "^2.4.0" } }, "node_modules/@testing-library/dom": { @@ -5782,6 +5340,17 @@ "license": "MIT", "peer": true }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, "node_modules/call-bind": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", @@ -6553,16 +6122,6 @@ "node": ">=6" } }, - "node_modules/detect-libc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", - "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", - "license": "Apache-2.0", - "optional": true, - "engines": { - "node": ">=8" - } - }, "node_modules/didyoumean": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", @@ -7962,8 +7521,7 @@ "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/graphemer": { "version": "1.4.0", @@ -9406,41 +8964,41 @@ "peer": true }, "node_modules/next": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/next/-/next-16.1.1.tgz", - "integrity": "sha512-QI+T7xrxt1pF6SQ/JYFz95ro/mg/1Znk5vBebsWwbpejj1T0A23hO7GYEaVac9QUOT2BIMiuzm0L99ooq7k0/w==", + "version": "14.2.35", + "resolved": "https://registry.npmjs.org/next/-/next-14.2.35.tgz", + "integrity": "sha512-KhYd2Hjt/O1/1aZVX3dCwGXM1QmOV4eNM2UTacK5gipDdPN/oHHK/4oVGy7X8GMfPMsUTUEmGlsy0EY1YGAkig==", "license": "MIT", "dependencies": { - "@next/env": "16.1.1", - "@swc/helpers": "0.5.15", - "baseline-browser-mapping": "^2.8.3", + "@next/env": "14.2.35", + "@swc/helpers": "0.5.5", + "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", + "graceful-fs": "^4.2.11", "postcss": "8.4.31", - "styled-jsx": "5.1.6" + "styled-jsx": "5.1.1" }, "bin": { "next": "dist/bin/next" }, "engines": { - "node": ">=20.9.0" + "node": ">=18.17.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "16.1.1", - "@next/swc-darwin-x64": "16.1.1", - "@next/swc-linux-arm64-gnu": "16.1.1", - "@next/swc-linux-arm64-musl": "16.1.1", - "@next/swc-linux-x64-gnu": "16.1.1", - "@next/swc-linux-x64-musl": "16.1.1", - "@next/swc-win32-arm64-msvc": "16.1.1", - "@next/swc-win32-x64-msvc": "16.1.1", - "sharp": "^0.34.4" + "@next/swc-darwin-arm64": "14.2.33", + "@next/swc-darwin-x64": "14.2.33", + "@next/swc-linux-arm64-gnu": "14.2.33", + "@next/swc-linux-arm64-musl": "14.2.33", + "@next/swc-linux-x64-gnu": "14.2.33", + "@next/swc-linux-x64-musl": "14.2.33", + "@next/swc-win32-arm64-msvc": "14.2.33", + "@next/swc-win32-ia32-msvc": "14.2.33", + "@next/swc-win32-x64-msvc": "14.2.33" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", - "@playwright/test": "^1.51.1", - "babel-plugin-react-compiler": "*", - "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", - "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "@playwright/test": "^1.41.2", + "react": "^18.2.0", + "react-dom": "^18.2.0", "sass": "^1.3.0" }, "peerDependenciesMeta": { @@ -9450,9 +9008,6 @@ "@playwright/test": { "optional": true }, - "babel-plugin-react-compiler": { - "optional": true - }, "sass": { "optional": true } @@ -11194,7 +10749,7 @@ "version": "7.7.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", - "devOptional": true, + "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -11268,51 +10823,6 @@ "node": ">= 0.4" } }, - "node_modules/sharp": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz", - "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==", - "hasInstallScript": true, - "license": "Apache-2.0", - "optional": true, - "dependencies": { - "@img/colour": "^1.0.0", - "detect-libc": "^2.1.2", - "semver": "^7.7.3" - }, - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-darwin-arm64": "0.34.5", - "@img/sharp-darwin-x64": "0.34.5", - "@img/sharp-libvips-darwin-arm64": "1.2.4", - "@img/sharp-libvips-darwin-x64": "1.2.4", - "@img/sharp-libvips-linux-arm": "1.2.4", - "@img/sharp-libvips-linux-arm64": "1.2.4", - "@img/sharp-libvips-linux-ppc64": "1.2.4", - "@img/sharp-libvips-linux-riscv64": "1.2.4", - "@img/sharp-libvips-linux-s390x": "1.2.4", - "@img/sharp-libvips-linux-x64": "1.2.4", - "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", - "@img/sharp-libvips-linuxmusl-x64": "1.2.4", - "@img/sharp-linux-arm": "0.34.5", - "@img/sharp-linux-arm64": "0.34.5", - "@img/sharp-linux-ppc64": "0.34.5", - "@img/sharp-linux-riscv64": "0.34.5", - "@img/sharp-linux-s390x": "0.34.5", - "@img/sharp-linux-x64": "0.34.5", - "@img/sharp-linuxmusl-arm64": "0.34.5", - "@img/sharp-linuxmusl-x64": "0.34.5", - "@img/sharp-wasm32": "0.34.5", - "@img/sharp-win32-arm64": "0.34.5", - "@img/sharp-win32-ia32": "0.34.5", - "@img/sharp-win32-x64": "0.34.5" - } - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -11570,6 +11080,14 @@ "node": ">= 0.4" } }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -11810,9 +11328,9 @@ } }, "node_modules/styled-jsx": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz", - "integrity": "sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz", + "integrity": "sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==", "license": "MIT", "dependencies": { "client-only": "0.0.1" @@ -11821,7 +11339,7 @@ "node": ">= 12.0.0" }, "peerDependencies": { - "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0" + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0" }, "peerDependenciesMeta": { "@babel/core": { diff --git a/package.json b/package.json index 49a270e..8c90d28 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "leaflet": "^1.9.4", "leaflet.markercluster": "^1.5.3", "lucide-react": "^0.427.0", - "next": "^16.1.1", + "next": "^14.2.0", "next-auth": "^4.24.7", "otplib": "^12.0.1", "papaparse": "^5.4.1", diff --git a/src/app/api/documents/[id]/route.ts b/src/app/api/documents/[id]/route.ts index 8bdcf77..49f4c19 100644 --- a/src/app/api/documents/[id]/route.ts +++ b/src/app/api/documents/[id]/route.ts @@ -20,7 +20,7 @@ import { canAccessResource } from "@/lib/permissions"; export async function GET( request: NextRequest, - { params }: { params: Promise<{ id: string }> } + { params }: { params: { id: string } } ) { try { const session = await getServerSession(authOptions); @@ -28,9 +28,8 @@ export async function GET( return NextResponse.json({ error: "Non autorisé" }, { status: 401 }); } - const { id } = await params; const document = await prisma.document.findUnique({ - where: { id }, + where: { id: params.id }, include: { author: { select: { @@ -75,7 +74,7 @@ export async function GET( export async function PUT( request: NextRequest, - { params }: { params: Promise<{ id: string }> } + { params }: { params: { id: string } } ) { try { const session = await getServerSession(authOptions); @@ -83,13 +82,12 @@ export async function PUT( return NextResponse.json({ error: "Non autorisé" }, { status: 401 }); } - const { id } = await params; const data = await request.json(); const validatedData = documentSchema.parse(data); // Check if document exists const existingDocument = await prisma.document.findUnique({ - where: { id }, + where: { id: params.id }, }); if (!existingDocument) { @@ -102,7 +100,7 @@ export async function PUT( } const document = await prisma.document.update({ - where: { id }, + where: { id: params.id }, data: { title: validatedData.title, type: validatedData.type, @@ -155,7 +153,7 @@ export async function PUT( export async function DELETE( request: NextRequest, - { params }: { params: Promise<{ id: string }> } + { params }: { params: { id: string } } ) { try { const session = await getServerSession(authOptions); @@ -163,10 +161,9 @@ export async function DELETE( return NextResponse.json({ error: "Non autorisé" }, { status: 401 }); } - const { id } = await params; // Check if document exists const document = await prisma.document.findUnique({ - where: { id }, + where: { id: params.id }, }); if (!document) { @@ -193,7 +190,7 @@ export async function DELETE( // Delete document record await prisma.document.delete({ - where: { id }, + where: { id: params.id }, }); await prisma.auditLog.create({ @@ -201,7 +198,7 @@ export async function DELETE( userId: session.user.id, action: "DELETE", entity: "Document", - entityId: id, + entityId: params.id, changes: JSON.stringify({ deleted: true }), }, }); diff --git a/src/app/api/employees/[id]/route.ts b/src/app/api/employees/[id]/route.ts index fe98667..156cbe1 100644 --- a/src/app/api/employees/[id]/route.ts +++ b/src/app/api/employees/[id]/route.ts @@ -16,7 +16,7 @@ import { employeeSchema } from "@/lib/validations"; export async function GET( request: NextRequest, - { params }: { params: Promise<{ id: string }> } + { params }: { params: { id: string } } ) { try { const session = await getServerSession(authOptions); @@ -24,9 +24,8 @@ export async function GET( return NextResponse.json({ error: "Non autorisé" }, { status: 401 }); } - const { id } = await params; const employee = await prisma.employee.findUnique({ - where: { id }, + where: { id: params.id }, include: { user: { select: { @@ -88,7 +87,7 @@ export async function GET( export async function PUT( request: NextRequest, - { params }: { params: Promise<{ id: string }> } + { params }: { params: { id: string } } ) { try { const session = await getServerSession(authOptions); @@ -96,13 +95,12 @@ export async function PUT( return NextResponse.json({ error: "Non autorisé" }, { status: 401 }); } - const { id } = await params; const data = await request.json(); const validatedData = employeeSchema.parse(data); // Check if employee exists const existingEmployee = await prisma.employee.findUnique({ - where: { id }, + where: { id: params.id }, }); if (!existingEmployee) { @@ -110,7 +108,7 @@ export async function PUT( } const employee = await prisma.employee.update({ - where: { id }, + where: { id: params.id }, data: { userId: validatedData.userId || undefined, employeeNumber: validatedData.employeeNumber, @@ -165,7 +163,7 @@ export async function PUT( export async function DELETE( request: NextRequest, - { params }: { params: Promise<{ id: string }> } + { params }: { params: { id: string } } ) { try { const session = await getServerSession(authOptions); @@ -173,10 +171,9 @@ export async function DELETE( return NextResponse.json({ error: "Non autorisé" }, { status: 401 }); } - const { id } = await params; // Check if employee exists const employee = await prisma.employee.findUnique({ - where: { id }, + where: { id: params.id }, include: { salaries: true, bonuses: true, @@ -197,13 +194,13 @@ export async function DELETE( employee.missionAssignments.length > 0) { // Soft delete await prisma.employee.update({ - where: { id }, + where: { id: params.id }, data: { isActive: false }, }); } else { // Hard delete if no dependencies await prisma.employee.delete({ - where: { id }, + where: { id: params.id }, }); } @@ -212,7 +209,7 @@ export async function DELETE( userId: session.user.id, action: "DELETE", entity: "Employee", - entityId: id, + entityId: params.id, changes: JSON.stringify({ deleted: true }), }, }); diff --git a/src/app/api/equipment/[id]/route.ts b/src/app/api/equipment/[id]/route.ts index 4e7cd4f..af445f2 100644 --- a/src/app/api/equipment/[id]/route.ts +++ b/src/app/api/equipment/[id]/route.ts @@ -16,7 +16,7 @@ import { equipmentSchema } from "@/lib/validations"; export async function GET( request: NextRequest, - { params }: { params: Promise<{ id: string }> } + { params }: { params: { id: string } } ) { try { const session = await getServerSession(authOptions); @@ -24,9 +24,8 @@ export async function GET( return NextResponse.json({ error: "Non autorisé" }, { status: 401 }); } - const { id } = await params; const equipment = await prisma.equipment.findUnique({ - where: { id }, + where: { id: params.id }, include: { maintenances: { orderBy: { date: "desc" }, @@ -66,7 +65,7 @@ export async function GET( export async function PUT( request: NextRequest, - { params }: { params: Promise<{ id: string }> } + { params }: { params: { id: string } } ) { try { const session = await getServerSession(authOptions); @@ -74,13 +73,12 @@ export async function PUT( return NextResponse.json({ error: "Non autorisé" }, { status: 401 }); } - const { id } = await params; const data = await request.json(); const validatedData = equipmentSchema.parse(data); // Check if equipment exists const existingEquipment = await prisma.equipment.findUnique({ - where: { id }, + where: { id: params.id }, }); if (!existingEquipment) { @@ -88,7 +86,7 @@ export async function PUT( } const equipment = await prisma.equipment.update({ - where: { id }, + where: { id: params.id }, data: { name: validatedData.name, category: validatedData.category, @@ -134,7 +132,7 @@ export async function PUT( export async function DELETE( request: NextRequest, - { params }: { params: Promise<{ id: string }> } + { params }: { params: { id: string } } ) { try { const session = await getServerSession(authOptions); @@ -142,10 +140,9 @@ export async function DELETE( return NextResponse.json({ error: "Non autorisé" }, { status: 401 }); } - const { id } = await params; // Check if equipment exists const equipment = await prisma.equipment.findUnique({ - where: { id }, + where: { id: params.id }, include: { maintenances: true, missionEquipment: true, @@ -160,7 +157,7 @@ export async function DELETE( if (equipment.missionEquipment.length > 0) { // Soft delete by changing status to RETIRED await prisma.equipment.update({ - where: { id }, + where: { id: params.id }, data: { status: "RETIRED" }, }); @@ -169,7 +166,7 @@ export async function DELETE( userId: session.user.id, action: "DELETE", entity: "Equipment", - entityId: id, + entityId: params.id, changes: JSON.stringify({ status: "RETIRED", softDelete: true }), }, }); @@ -181,7 +178,7 @@ export async function DELETE( } else { // Hard delete if no dependencies await prisma.equipment.delete({ - where: { id }, + where: { id: params.id }, }); await prisma.auditLog.create({ @@ -189,7 +186,7 @@ export async function DELETE( userId: session.user.id, action: "DELETE", entity: "Equipment", - entityId: id, + entityId: params.id, changes: JSON.stringify({ deleted: true }), }, }); diff --git a/src/app/api/missions/[id]/route.ts b/src/app/api/missions/[id]/route.ts index 4de7e61..43bc348 100644 --- a/src/app/api/missions/[id]/route.ts +++ b/src/app/api/missions/[id]/route.ts @@ -17,7 +17,7 @@ import { notifyMissionCompleted } from "@/lib/notifications"; export async function GET( request: NextRequest, - { params }: { params: Promise<{ id: string }> } + { params }: { params: { id: string } } ) { try { const session = await getServerSession(authOptions); @@ -25,9 +25,8 @@ export async function GET( return NextResponse.json({ error: "Non autorisé" }, { status: 401 }); } - const { id } = await params; const mission = await prisma.mission.findUnique({ - where: { id }, + where: { id: params.id }, include: { creator: { select: { @@ -112,7 +111,7 @@ export async function GET( export async function PUT( request: NextRequest, - { params }: { params: Promise<{ id: string }> } + { params }: { params: { id: string } } ) { try { const session = await getServerSession(authOptions); @@ -120,13 +119,12 @@ export async function PUT( return NextResponse.json({ error: "Non autorisé" }, { status: 401 }); } - const { id } = await params; const data = await request.json(); const validatedData = missionSchema.parse(data); // Check if mission exists const existingMission = await prisma.mission.findUnique({ - where: { id: id }, + where: { id: params.id }, }); if (!existingMission) { @@ -135,7 +133,7 @@ export async function PUT( // Update mission basic data const mission = await prisma.mission.update({ - where: { id: id }, + where: { id: params.id }, data: { title: validatedData.title, description: validatedData.description || undefined, @@ -180,14 +178,14 @@ export async function PUT( if (data.teamMembers && Array.isArray(data.teamMembers)) { // Delete existing teams await prisma.missionTeam.deleteMany({ - where: { missionId: id }, + where: { missionId: params.id }, }); // Create new teams if (data.teamMembers.length > 0) { await prisma.missionTeam.createMany({ data: data.teamMembers.map((userId: string) => ({ - missionId: id, + missionId: params.id, userId, role: "member", })), @@ -199,14 +197,14 @@ export async function PUT( if (data.equipmentIds && Array.isArray(data.equipmentIds)) { // Delete existing equipment assignments await prisma.missionEquipment.deleteMany({ - where: { missionId: id }, + where: { missionId: params.id }, }); // Create new equipment assignments if (data.equipmentIds.length > 0) { await prisma.missionEquipment.createMany({ data: data.equipmentIds.map((equipmentId: string) => ({ - missionId: id, + missionId: params.id, equipmentId, quantity: 1, })), @@ -231,7 +229,7 @@ export async function PUT( // Fetch updated mission with all relations const updatedMission = await prisma.mission.findUnique({ - where: { id: id }, + where: { id: params.id }, include: { creator: { select: { @@ -279,7 +277,7 @@ export async function PUT( export async function DELETE( request: NextRequest, - { params }: { params: Promise<{ id: string }> } + { params }: { params: { id: string } } ) { try { const session = await getServerSession(authOptions); @@ -287,10 +285,9 @@ export async function DELETE( return NextResponse.json({ error: "Non autorisé" }, { status: 401 }); } - const { id } = await params; // Check if mission exists const mission = await prisma.mission.findUnique({ - where: { id: id }, + where: { id: params.id }, include: { teams: true, equipment: true, @@ -309,7 +306,7 @@ export async function DELETE( if (mission.documents.length > 0 || mission.report) { // Option 1: Soft delete by changing status await prisma.mission.update({ - where: { id: id }, + where: { id: params.id }, data: { status: "cancelled" }, }); @@ -318,7 +315,7 @@ export async function DELETE( userId: session.user.id, action: "DELETE", entity: "Mission", - entityId: id, + entityId: params.id, changes: JSON.stringify({ status: "cancelled", softDelete: true }), }, }); @@ -330,7 +327,7 @@ export async function DELETE( } else { // Hard delete if no critical dependencies await prisma.mission.delete({ - where: { id: id }, + where: { id: params.id }, }); await prisma.auditLog.create({ @@ -338,7 +335,7 @@ export async function DELETE( userId: session.user.id, action: "DELETE", entity: "Mission", - entityId: id, + entityId: params.id, changes: JSON.stringify({ deleted: true }), }, }); diff --git a/src/app/api/species/[id]/route.ts b/src/app/api/species/[id]/route.ts index 1e9d86c..d0b7443 100644 --- a/src/app/api/species/[id]/route.ts +++ b/src/app/api/species/[id]/route.ts @@ -16,7 +16,7 @@ import { speciesSchema } from "@/lib/validations"; export async function GET( request: NextRequest, - { params }: { params: Promise<{ id: string }> } + { params }: { params: { id: string } } ) { try { const session = await getServerSession(authOptions); @@ -24,9 +24,8 @@ export async function GET( return NextResponse.json({ error: "Non autorisé" }, { status: 401 }); } - const { id } = await params; const species = await prisma.species.findUnique({ - where: { id }, + where: { id: params.id }, include: { observations: { orderBy: { date: "desc" }, @@ -72,7 +71,7 @@ export async function GET( export async function PUT( request: NextRequest, - { params }: { params: Promise<{ id: string }> } + { params }: { params: { id: string } } ) { try { const session = await getServerSession(authOptions); @@ -80,13 +79,12 @@ export async function PUT( return NextResponse.json({ error: "Non autorisé" }, { status: 401 }); } - const { id } = await params; const data = await request.json(); const validatedData = speciesSchema.parse(data); // Check if species exists const existingSpecies = await prisma.species.findUnique({ - where: { id }, + where: { id: params.id }, }); if (!existingSpecies) { @@ -94,7 +92,7 @@ export async function PUT( } const species = await prisma.species.update({ - where: { id }, + where: { id: params.id }, data: { scientificName: validatedData.scientificName, commonName: validatedData.commonName || undefined, @@ -136,7 +134,7 @@ export async function PUT( export async function DELETE( request: NextRequest, - { params }: { params: Promise<{ id: string }> } + { params }: { params: { id: string } } ) { try { const session = await getServerSession(authOptions); @@ -144,10 +142,9 @@ export async function DELETE( return NextResponse.json({ error: "Non autorisé" }, { status: 401 }); } - const { id } = await params; // Check if species exists const species = await prisma.species.findUnique({ - where: { id }, + where: { id: params.id }, include: { observations: true, locations: true, @@ -177,7 +174,7 @@ export async function DELETE( // Only allow deletion if no scientific data exists await prisma.species.delete({ - where: { id }, + where: { id: params.id }, }); await prisma.auditLog.create({ @@ -185,7 +182,7 @@ export async function DELETE( userId: session.user.id, action: "DELETE", entity: "Species", - entityId: id, + entityId: params.id, changes: JSON.stringify({ deleted: true }), }, }); diff --git a/src/app/api/users/[id]/route.ts b/src/app/api/users/[id]/route.ts index aba0235..7069ce3 100644 --- a/src/app/api/users/[id]/route.ts +++ b/src/app/api/users/[id]/route.ts @@ -16,7 +16,7 @@ import bcrypt from "bcryptjs"; export async function GET( request: NextRequest, - { params }: { params: Promise<{ id: string }> } + { params }: { params: { id: string } } ) { try { const session = await getServerSession(authOptions); @@ -24,9 +24,8 @@ export async function GET( return NextResponse.json({ error: "Non autorisé" }, { status: 401 }); } - const { id } = await params; const user = await prisma.user.findUnique({ - where: { id }, + where: { id: params.id }, select: { id: true, firstName: true, @@ -55,7 +54,7 @@ export async function GET( export async function PUT( request: NextRequest, - { params }: { params: Promise<{ id: string }> } + { params }: { params: { id: string } } ) { try { const session = await getServerSession(authOptions); @@ -63,13 +62,12 @@ export async function PUT( return NextResponse.json({ error: "Non autorisé" }, { status: 401 }); } - const { id } = await params; const data = await request.json(); const { firstName, lastName, email, password, role, isActive } = data; // Check if user exists const existingUser = await prisma.user.findUnique({ - where: { id }, + where: { id: params.id }, }); if (!existingUser) { @@ -104,7 +102,7 @@ export async function PUT( } const user = await prisma.user.update({ - where: { id }, + where: { id: params.id }, data: updateData, select: { id: true, diff --git a/tsconfig.json b/tsconfig.json index e1b116d..79cde90 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,11 +1,7 @@ { "compilerOptions": { "target": "ES2020", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], + "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -15,7 +11,7 @@ "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "react-jsx", + "jsx": "preserve", "incremental": true, "plugins": [ { @@ -23,19 +19,10 @@ } ], "paths": { - "@/*": [ - "./src/*" - ] + "@/*": ["./src/*"] } }, - "include": [ - "next-env.d.ts", - "**/*.ts", - "**/*.tsx", - ".next/types/**/*.ts", - ".next/dev/types/**/*.ts" - ], - "exclude": [ - "node_modules" - ] + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "exclude": ["node_modules"] } +