mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-27 06:13:06 +00:00
OH14 — knip: remove exports orphaned by outbox-only paths
This commit is contained in:
parent
34a1308f5d
commit
f67a4c27e9
4 changed files with 2 additions and 54 deletions
|
|
@ -4,17 +4,12 @@ import { revalidatePath } from 'next/cache'
|
||||||
|
|
||||||
import { MAX_VOTE_COUNT } from '@/lib/schemas/primitives'
|
import { MAX_VOTE_COUNT } from '@/lib/schemas/primitives'
|
||||||
|
|
||||||
import { declareVotes, estimateVotes } from '@/app/(campaign)/campanha/actions/votePledge'
|
import { declareVotes } from '@/app/(campaign)/campanha/actions/votePledge'
|
||||||
import {
|
import {
|
||||||
nullableFormText,
|
|
||||||
requiredIntegerFormValue,
|
requiredIntegerFormValue,
|
||||||
requiredRelationshipFormValue,
|
requiredRelationshipFormValue,
|
||||||
voteEstimateScenarioFromForm,
|
|
||||||
} from '@/lib/formData'
|
} from '@/lib/formData'
|
||||||
import {
|
import { VOTE_PLEDGE_DECLARE_SAFE_MESSAGES } from '@/lib/schemas/votePledge'
|
||||||
VOTE_PLEDGE_DECLARE_SAFE_MESSAGES,
|
|
||||||
VOTE_PLEDGE_ESTIMATE_SAFE_MESSAGES,
|
|
||||||
} from '@/lib/schemas/votePledge'
|
|
||||||
import {
|
import {
|
||||||
runCampaignFormAction,
|
runCampaignFormAction,
|
||||||
type CampaignFormActionState,
|
type CampaignFormActionState,
|
||||||
|
|
@ -43,26 +38,3 @@ export const declareVotesFormAction = async (
|
||||||
genericMessage:
|
genericMessage:
|
||||||
'Não foi possível registrar a declaração. Verifique seu acesso e tente novamente.',
|
'Não foi possível registrar a declaração. Verifique seu acesso e tente novamente.',
|
||||||
})
|
})
|
||||||
|
|
||||||
export const estimateVotesFormAction = async (
|
|
||||||
_state: CampaignFormActionState,
|
|
||||||
formData: FormData,
|
|
||||||
): Promise<CampaignFormActionState> =>
|
|
||||||
runCampaignFormAction({
|
|
||||||
execute: async () => {
|
|
||||||
const pledge = requiredRelationshipFormValue(formData, 'pledgeId')
|
|
||||||
const estimatedVotes = voteEstimateScenarioFromForm(formData, 'estimatedVotes')
|
|
||||||
const estimateNote = nullableFormText(formData, 'estimateNote')
|
|
||||||
|
|
||||||
await estimateVotes({
|
|
||||||
pledge,
|
|
||||||
estimatedVotes,
|
|
||||||
estimateNote,
|
|
||||||
})
|
|
||||||
revalidatePath('/campanha/municipios/[slug]', 'page')
|
|
||||||
return { message: 'Estimativa registrada.' }
|
|
||||||
},
|
|
||||||
safeMessages: VOTE_PLEDGE_ESTIMATE_SAFE_MESSAGES,
|
|
||||||
genericMessage:
|
|
||||||
'Não foi possível registrar a estimativa. Verifique seu acesso e tente novamente.',
|
|
||||||
})
|
|
||||||
|
|
|
||||||
|
|
@ -206,11 +206,6 @@ export const createCampaignDemand = async (input: CampaignDemandCreateInput) =>
|
||||||
return createCampaignDemandRecord(payload, actor, input)
|
return createCampaignDemandRecord(payload, actor, input)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const transitionCampaignDemand = async (input: CampaignDemandTransitionInput) => {
|
|
||||||
const { payload, actor } = await getCampaignActionContext()
|
|
||||||
return transitionCampaignDemandRecord(payload, actor, input)
|
|
||||||
}
|
|
||||||
|
|
||||||
export const transitionCampaignDemandCas = async (input: CampaignDemandTransitionInput) => {
|
export const transitionCampaignDemandCas = async (input: CampaignDemandTransitionInput) => {
|
||||||
const { payload, actor } = await getCampaignActionContext()
|
const { payload, actor } = await getCampaignActionContext()
|
||||||
return transitionCampaignDemandRecord(payload, actor, input, { cas: true })
|
return transitionCampaignDemandRecord(payload, actor, input, { cas: true })
|
||||||
|
|
|
||||||
|
|
@ -93,16 +93,6 @@ export const requiredIntegerFormValue = (
|
||||||
return parsed
|
return parsed
|
||||||
}
|
}
|
||||||
|
|
||||||
export const optionalIntegerFormValue = (
|
|
||||||
formData: FormData,
|
|
||||||
field: string,
|
|
||||||
options?: { minimum?: number; maximum?: number },
|
|
||||||
): number | undefined => {
|
|
||||||
const entry = formEntry(formData, field)
|
|
||||||
if (!entry.present || !entry.value.trim()) return undefined
|
|
||||||
return requiredIntegerFormValue(formData, field, options)
|
|
||||||
}
|
|
||||||
|
|
||||||
const optionalNullableIntegerFormValue = (
|
const optionalNullableIntegerFormValue = (
|
||||||
formData: FormData,
|
formData: FormData,
|
||||||
field: string,
|
field: string,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
import { OPS_UPDATED_AT_CONFLICT_MESSAGE } from '@/lib/schemas/opsCas'
|
|
||||||
|
|
||||||
export const campaignDemandKinds = [
|
export const campaignDemandKinds = [
|
||||||
'material',
|
'material',
|
||||||
'servico',
|
'servico',
|
||||||
|
|
@ -80,13 +78,6 @@ export const CAMPAIGN_DEMAND_RECEIPT_TYPE_MESSAGE = 'Envie uma imagem (JPEG, PNG
|
||||||
export const CAMPAIGN_DEMAND_RECEIPT_EMPTY_MESSAGE = 'O arquivo enviado está vazio.'
|
export const CAMPAIGN_DEMAND_RECEIPT_EMPTY_MESSAGE = 'O arquivo enviado está vazio.'
|
||||||
export const CAMPAIGN_DEMAND_RECEIPT_SIZE_MESSAGE = 'O comprovante deve ter no máximo 10 MB.'
|
export const CAMPAIGN_DEMAND_RECEIPT_SIZE_MESSAGE = 'O comprovante deve ter no máximo 10 MB.'
|
||||||
|
|
||||||
export const CAMPAIGN_DEMAND_TRANSITION_SAFE_MESSAGES = [
|
|
||||||
CAMPAIGN_DEMAND_TRANSITION_STAFF_MESSAGE,
|
|
||||||
CAMPAIGN_DEMAND_ESCALATED_DECISION_MESSAGE,
|
|
||||||
CAMPAIGN_DEMAND_INVALID_STATUS_MESSAGE,
|
|
||||||
OPS_UPDATED_AT_CONFLICT_MESSAGE,
|
|
||||||
] as const
|
|
||||||
|
|
||||||
export const CAMPAIGN_DEMAND_RECEIPT_SAFE_MESSAGES = [
|
export const CAMPAIGN_DEMAND_RECEIPT_SAFE_MESSAGES = [
|
||||||
CAMPAIGN_DEMAND_RECEIPT_TYPE_MESSAGE,
|
CAMPAIGN_DEMAND_RECEIPT_TYPE_MESSAGE,
|
||||||
CAMPAIGN_DEMAND_RECEIPT_EMPTY_MESSAGE,
|
CAMPAIGN_DEMAND_RECEIPT_EMPTY_MESSAGE,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue