FIX: Bugs

This commit is contained in:
2025-04-19 23:33:11 +03:30
parent 6367325622
commit 0fe0587846
7 changed files with 52 additions and 23 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
const multer = require('multer')
const AppError = require('../globalErrorHandler/AppError')
const types = ['png', 'jpg', 'jpeg', 'webp']
const types = ['png', 'jpg', 'jpeg', 'webp', 'pdf', 'doc', 'docx', 'xlsx', 'dwg']
const formatsText = types.join(' - ')
const fileFilter = (req, file, cb) => {
+2 -2
View File
@@ -19,7 +19,7 @@ const requires = (...permissions) => {
if (
!checker(rolePerm, perm?._id) &&
!checker(userPerm, perm?._id) &&
role._id.toString() !== process.env.SUPER_ADMIN_ID
role._id.toString() !== process.env.SUPER_ADMIN_ROLE_ID
) {
throw new AppError('NoPermissionAccess', 403, {})
}
@@ -50,7 +50,7 @@ const adminCheck = () => {
if (
!checker(rolePerm, perm?._id) &&
!checker(userPerm, perm?._id) &&
user.role?._id.toString() !== process.env.SUPER_ADMIN_ID
user.role?._id.toString() !== process.env.SUPER_ADMIN_ROLE_ID
) {
throw new AppError('NoPermissionAccess', 403, {})
}