Skip to content

Commit

Permalink
feat: disable grant and pitch proposal submission (#1893)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyesp authored Nov 12, 2024
1 parent 002257d commit 528deeb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/routes/proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ import { isProdEnv } from '../utils/governanceEnvs'
import logger from '../utils/logger'
import { validateAddress, validateId, validateIsDaoCommittee, validateStatusUpdate } from '../utils/validations'

const PITCH_PROPOSAL_SUBMIT_ENABLED = false
const GRANT_PROPOSAL_SUBMIT_ENABLED = false

export default routes((route) => {
const withAuth = auth()
const withOptionalAuth = auth({ optional: true })
Expand Down Expand Up @@ -371,6 +374,10 @@ export async function createProposalCatalyst(req: WithAuth) {
}

export async function createProposalGrant(req: WithAuth) {
if (!GRANT_PROPOSAL_SUBMIT_ENABLED) {
throw new RequestError('Grant proposal submission is not enabled', RequestError.Forbidden)
}

const grantRequestSchema = getGrantRequestSchema(req.body.category)
const newProposalGrantValidator = schema.compile(grantRequestSchema)
const user = req.auth!
Expand Down Expand Up @@ -401,6 +408,10 @@ export async function createProposalLinkedWearables(req: WithAuth) {
const newProposalPitchValidator = schema.compile(newProposalPitchScheme)

export async function createProposalPitch(req: WithAuth) {
if (!PITCH_PROPOSAL_SUBMIT_ENABLED) {
throw new RequestError('Pitch proposal submission is not enabled', RequestError.Forbidden)
}

const user = req.auth!
const configuration = validate<NewProposalPitch>(newProposalPitchValidator, req.body || {})

Expand Down

0 comments on commit 528deeb

Please sign in to comment.