Skip to content

Commit

Permalink
prevent usert from update profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Salah Eddine Lalami committed Oct 30, 2023
1 parent 2c3197d commit 05116ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"githubPullRequests.ignoredPullRequestBranches": ["master"]
}
2 changes: 1 addition & 1 deletion backend/routes/coreRoutes/coreApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ router
router
.route('/profile/update/:id')
.patch(
hasPermission('read'),
hasPermission(),
adminPhotoUpload.single('file'),
setFilePathToBody('photo'),
catchErrors(adminController.updateProfile)
Expand Down
3 changes: 3 additions & 0 deletions backend/setup/reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ mongoose.Promise = global.Promise; // Tell Mongoose to use ES6 promises
async function deleteData() {
const Admin = require('../models/coreModels/Admin');
const Setting = require('../models/coreModels/Setting');
const Email = require('../models/coreModels/Email');
await Admin.remove();
console.log('👍 admin Deleted. To setup demo admin data, run\n\n\t npm run setup\n\n');
await Setting.remove();
console.log('👍 Setting Deleted. To setup demo admin data, run\n\n\t npm run setup\n\n');
await Email.remove();
console.log('👍 Email Deleted. To setup demo admin data, run\n\n\t npm run setup\n\n');
process.exit();
}

Expand Down

0 comments on commit 05116ac

Please sign in to comment.