From 36f85e96d90aa9ad192cf61a58f271f2dcea4dca Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 2 Aug 2026 03:48:18 +0000 Subject: [PATCH] =?UTF-8?q?OH14=20=E2=80=94=20remove=20orphaned=20transiti?= =?UTF-8?q?onDemandFormAction=20after=20outbox-only=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Francisco Solla --- .../(app)/demandas/[slug]/formActions.ts | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/src/app/(campaign)/campanha/(app)/demandas/[slug]/formActions.ts b/src/app/(campaign)/campanha/(app)/demandas/[slug]/formActions.ts index 8bf9d62e..2d9840a7 100644 --- a/src/app/(campaign)/campanha/(app)/demandas/[slug]/formActions.ts +++ b/src/app/(campaign)/campanha/(app)/demandas/[slug]/formActions.ts @@ -5,21 +5,14 @@ import { revalidatePath } from 'next/cache' import { attachCampaignDemandReceiptRecord, setCampaignDemandCost, - transitionCampaignDemand, } from '@/app/(campaign)/campanha/actions/demand' import { FormDataBoundaryError, - nullableFormText, - requiredFormText, requiredRelationshipFormValue, } from '@/lib/formData' import { CAMPAIGN_DEMAND_COST_STAFF_MESSAGE, - CAMPAIGN_DEMAND_INVALID_STATUS_MESSAGE, CAMPAIGN_DEMAND_RECEIPT_SAFE_MESSAGES, - CAMPAIGN_DEMAND_TRANSITION_SAFE_MESSAGES, - campaignDemandStatuses, - type CampaignDemandStatus, } from '@/lib/schemas/campaignDemand' import { getCampaignActionContext } from '@/utilities/campaignActionContext' import { @@ -27,33 +20,6 @@ import { type CampaignFormActionState, } from '@/utilities/campaignFormActionError' -const INVALID_STATUS_MESSAGE = CAMPAIGN_DEMAND_INVALID_STATUS_MESSAGE - -const transitionSafeMessages = CAMPAIGN_DEMAND_TRANSITION_SAFE_MESSAGES - -export const transitionDemandFormAction = async ( - _state: CampaignFormActionState, - formData: FormData, -): Promise => - runCampaignFormAction({ - execute: async () => { - const rawStatus = requiredFormText(formData, 'status') - if (!campaignDemandStatuses.includes(rawStatus as CampaignDemandStatus)) { - throw new Error(INVALID_STATUS_MESSAGE) - } - - await transitionCampaignDemand({ - id: requiredRelationshipFormValue(formData, 'demandId'), - status: rawStatus as CampaignDemandStatus, - decisionNote: nullableFormText(formData, 'decisionNote'), - }) - revalidatePath('/campanha/demandas/[slug]', 'page') - return { message: 'Demanda atualizada.' } - }, - safeMessages: transitionSafeMessages, - genericMessage: 'Não foi possível mover a demanda. Verifique seu acesso e tente novamente.', - }) - export const setDemandCostFormAction = async ( _state: CampaignFormActionState, formData: FormData,