Skip to content

Commit

Permalink
fix(change-requests): prevent incorrect scheduled changes warning (#3593
Browse files Browse the repository at this point in the history
)
  • Loading branch information
matthewelwell authored Mar 14, 2024
1 parent f9f40e9 commit 165088b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/web/components/ExistingChangeRequestAlert.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC } from 'react'
import { FC, useRef } from 'react';
import { useGetChangeRequestsQuery } from 'common/services/useChangeRequest'
import WarningMessage from './WarningMessage'
import moment from 'moment'
Expand All @@ -19,10 +19,11 @@ const ExistingChangeRequestAlert: FC<ExistingChangeRequestAlertType> = ({
environmentId,
feature_id: featureId,
})
const date = useRef(moment().toISOString())
const { data: scheduledChangeRequests } = useGetChangeRequestsQuery({
environmentId,
feature_id: featureId,
live_from_after: moment().startOf('hour').toISOString(),
live_from_after: date.current,
})

if (scheduledChangeRequests?.results?.length) {
Expand Down

0 comments on commit 165088b

Please sign in to comment.