Use entries count for access review closure
Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
committed by
Bryan Frimin
parent
5bf8727076
commit
ba2a47d262
@@ -148,7 +148,9 @@ export const campaignDetailPageQuery = graphql`
|
|||||||
id
|
id
|
||||||
name
|
name
|
||||||
status
|
status
|
||||||
pendingEntryCount
|
pendingEntries: entries(first: 0, filter: { decision: PENDING }) {
|
||||||
|
totalCount
|
||||||
|
}
|
||||||
canDelete: permission(action: "access-review:campaign:delete")
|
canDelete: permission(action: "access-review:campaign:delete")
|
||||||
sources {
|
sources {
|
||||||
id
|
id
|
||||||
@@ -249,7 +251,7 @@ export default function CampaignDetailPage({ queryRef }: Props) {
|
|||||||
const [deleteCampaign, isDeleting]
|
const [deleteCampaign, isDeleting]
|
||||||
= useMutation<CampaignDetailPageDeleteMutation>(deleteCampaignMutation);
|
= useMutation<CampaignDetailPageDeleteMutation>(deleteCampaignMutation);
|
||||||
|
|
||||||
const canComplete = campaign.pendingEntryCount === 0;
|
const canComplete = campaign.pendingEntries.totalCount === 0;
|
||||||
|
|
||||||
const handleStart = () => {
|
const handleStart = () => {
|
||||||
startCampaign({
|
startCampaign({
|
||||||
|
|||||||
Reference in New Issue
Block a user