diff --git a/src/controllers/audit.controller.js b/src/controllers/audit.controller.js index 131637e3..da9ec7ab 100644 --- a/src/controllers/audit.controller.js +++ b/src/controllers/audit.controller.js @@ -41,13 +41,9 @@ export const findConflicts = async (req, res) => { export const resetToGeneration = async (req, res) => { try { - const { generation, orgUid, includeHomeOrg } = req.body; + const { generation, orgUid } = req.body; - const result = await Audit.resetToGeneration( - generation, - orgUid, - includeHomeOrg, - ); + const result = await Audit.resetToGeneration(generation, orgUid); if (_.isNil(result)) { throw new Error('query failed'); } diff --git a/src/models/audit/audit.model.js b/src/models/audit/audit.model.js index 54c7d8bc..e10057df 100644 --- a/src/models/audit/audit.model.js +++ b/src/models/audit/audit.model.js @@ -47,18 +47,11 @@ class Audit extends Model { return results; } - static async resetToGeneration(generation, orgUid, includeHomeOrg) { - const homeOrg = Organization.getHomeOrg(); - const homeOrgUid = homeOrg?.uid; - + static async resetToGeneration(generation, orgUid) { const where = { generation: { [Sequelize.Op.gt]: generation }, }; - if (!includeHomeOrg && homeOrgUid && orgUid !== homeOrgUid) { - where.orgUid = { [Sequelize.Op.ne]: homeOrgUid }; - } - if (orgUid) { where.orgUid = orgUid; } diff --git a/src/validations/audit.validations.js b/src/validations/audit.validations.js index 295cb5e0..9a017b69 100644 --- a/src/validations/audit.validations.js +++ b/src/validations/audit.validations.js @@ -13,7 +13,6 @@ export const auditGetSchema = Joi.object() export const auditResetToGenerationSchema = Joi.object().keys({ generation: Joi.number(), orgUid: Joi.string(), - includeHomeOrg: Joi.bool().optional(), }); export const auditResetToDateSchema = Joi.object().keys({