Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: disable grant and pitch proposal submission #1893

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading