Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ help:
@echo "make doc Build the documentation"
@echo "make dev-build Build the frontend (make dev-build-frontend) and run the backend in development mode"
@echo "make dev-backend Run backend in development mode"
@echo "make dev-backend-wizard Run backend in development mode with setup wizard enabled"
@echo "make dev-backend-watch Run backend in development mode with nodemon (auto-restart)"
@echo "make dev-frontend Run frontend in development mode"
@echo "make dev-build-frontend Build frontend in development mode"
Expand Down Expand Up @@ -100,16 +99,10 @@ dev-build: backend/node_modules/.uptodate build-frontend
cd backend && npm run start

.PHONY: dev-backend
dev-backend: DEV_SKIP_WIZARD=true
dev-backend: backend/node_modules/.uptodate
cd backend && npm run start

.PHONY: dev-backend-wizard
dev-backend-wizard: backend/node_modules/.uptodate
cd backend && npm run start

.PHONY: dev-backend-watch
dev-backend-watch: DEV_SKIP_WIZARD=true
dev-backend-watch: backend/node_modules/.uptodate
cd backend && npm run start:watch

Expand Down
21 changes: 1 addition & 20 deletions backend/db/MetaModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,29 +245,10 @@ module.exports = class MetaModel extends Model {
* Delete db entry by id
* @param {number} id
* @param {Object} [options={}] - Optional Sequelize query options
* @param {boolean} [options.force=false] - If true, permanently destroys the record instead of soft-deleting.
* @return {Promise<object|undefined>}
*/
static async deleteById(id, options = {}) {
const { force = false, ...restOptions } = options;
if (force) {
return await this.destroyById(id, restOptions);
}
return await this.updateById(id, {deleted: true}, restOptions);
}

/**
* Physically destroy a db entry by id, firing all instance-level hooks
* (beforeDestroy, afterDestroy) so that plugins like GlobalChangeTrackingPlugin
* can track the change automatically.
* @param {number} id
* @param {Object} [options={}] - Optional Sequelize query options (e.g. transaction)
* @return {Promise<void>}
*/
static async destroyById(id, options = {}) {
const instance = await this.findOne({ where: { id }, transaction: options.transaction });
if (!instance) return;
return await instance.destroy(options);
return await this.updateById(id, {deleted: true}, options);
}

/**
Expand Down
Loading
Loading