Skip to content

Commit bd22893

Browse files
committed
feature/organization - added softDelete hook to model
1 parent 9078ee0 commit bd22893

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"dev:debug": "npm run clear && concurrently '$npm_package_config_mongoDev' 'wait-on tcp:27017 && NODE_ENV=development nodemon --inspect server/'",
4242
"dev": "npm run clear && concurrently '$npm_package_config_mongoDev' 'wait-on tcp:27017 && NODE_ENV=development DEBUG=feathers nodemon server/'",
4343
"dev:noseed": "concurrently 'mongod --dbpath data' 'wait-on tcp:27017 && NODE_ENV=development DEBUG=feathers nodemon server/'",
44-
"dev:win": "npm run clear && concurrently \"mongod --dbpath data\" \"wait-on tcp:27017&&SET NODE_ENV=development&&SET DEBUG=feathers&& nodemon --inspect server/\"",
44+
"dev:win": "npm run clear && concurrently \"mongod --dbpath /data/db\" \"wait-on tcp:27017&& cross-env NODE_ENV=development&& cross-env DEBUG=feathers&& nodemon --inspect server/\"",
4545
"mocha": "npm run clear && $npm_package_config_concurrently '$npm_package_config_mongoDev &>/dev/null' 'wait-on tcp:27017 && NODE_ENV=test $npm_package_config_mocha'",
4646
"coverage": "npm run clear && $npm_package_config_concurrently '$npm_package_config_mongoDev &>/dev/null' 'wait-on tcp:27017 && NODE_ENV=test istanbul cover $npm_package_config_mochaCoverage'"
4747
},
@@ -55,6 +55,7 @@
5555
"body-parser": "~1.18.2",
5656
"compression": "~1.7.1",
5757
"cors": "~2.8.4",
58+
"cross-env": "^5.1.4",
5859
"crypto": "~1.0.1",
5960
"crypto-js": "~3.1.9-1",
6061
"dauria": "~2.0.0",

server/models/organizations.model.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ module.exports = function (app) {
2626
type: Boolean,
2727
default: false
2828
},
29+
deleted: {
30+
type: Boolean,
31+
default: false
32+
},
2933
wasSeeded: { type: Boolean }
3034
});
3135

server/services/organizations/organizations.hooks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { unless, isProvider } = require('feathers-hooks-common');
1+
const { unless, isProvider, softDelete } = require('feathers-hooks-common');
22
const { isVerified } = require('feathers-authentication-management').hooks;
33
const { authenticate } = require('feathers-authentication').hooks;
44
const { associateCurrentUser, restrictToOwner } = require('feathers-authentication-hooks');
@@ -24,7 +24,7 @@ const thumbnailOptions = {
2424

2525
module.exports = {
2626
before: {
27-
all: [],
27+
all: softDelete(),
2828
find: [
2929
unless(isModerator(),
3030
excludeDisabled()

0 commit comments

Comments
 (0)