Skip to content

Commit

Permalink
feat: added read-only check to reset date and audit endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
wwills2 committed May 30, 2024
1 parent e23ccba commit 2b015c2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/controllers/audit.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
paginationParams,
optionallyPaginatedResponse,
} from '../utils/helpers';
import { assertIfReadOnlyMode } from '../utils/data-assertions.js';

export const findAll = async (req, res) => {
try {
Expand Down Expand Up @@ -41,6 +42,7 @@ export const findConflicts = async (req, res) => {

export const resetToGeneration = async (req, res) => {
try {
await assertIfReadOnlyMode();
const { generation, orgUid } = req.body;

const result = await Audit.resetToGeneration(generation, orgUid);
Expand Down Expand Up @@ -72,6 +74,7 @@ export const resetToGeneration = async (req, res) => {

export const resetToDate = async (req, res) => {
try {
await assertIfReadOnlyMode();
const { date, orgUid, includeHomeOrg } = req.body;

const result = orgUid
Expand Down

0 comments on commit 2b015c2

Please sign in to comment.