Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion apps/web/lib/zod/schemas/bounties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export const MAX_SUBMISSION_URLS = 20;

export const MAX_BOUNTY_SUBMISSION_DESCRIPTION_LENGTH = 1000;

export const MAX_BOUNTY_SUBMISSION_REJECTION_NOTE_LENGTH = 5000;

export const REJECT_BOUNTY_SUBMISSION_REASONS = {
invalidProof: "Invalid proof",
duplicateSubmission: "Duplicate submission",
Expand Down Expand Up @@ -163,7 +165,11 @@ export const rejectBountySubmissionSchema = z.object({
workspaceId: z.string(),
submissionId: z.string(),
rejectionReason: z.nativeEnum(BountySubmissionRejectionReason),
rejectionNote: z.string().trim().max(500).optional(),
rejectionNote: z
.string()
.trim()
.max(MAX_BOUNTY_SUBMISSION_REJECTION_NOTE_LENGTH)
.optional(),
});

export const getBountySubmissionsQuerySchema = z
Expand Down
8 changes: 5 additions & 3 deletions apps/web/ui/partners/reject-bounty-submission-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import useBounty from "@/lib/swr/use-bounty";
import useWorkspace from "@/lib/swr/use-workspace";
import { BountySubmissionProps } from "@/lib/types";
import {
MAX_BOUNTY_SUBMISSION_REJECTION_NOTE_LENGTH,
REJECT_BOUNTY_SUBMISSION_REASONS,
rejectBountySubmissionSchema,
} from "@/lib/zod/schemas/bounties";
Expand Down Expand Up @@ -138,18 +139,19 @@ const RejectBountySubmissionModal = ({
</span>
</label>
<span className="text-xs text-neutral-400">
{watch("rejectionNote")?.length || 0}/5,000
{watch("rejectionNote")?.length || 0}/
{MAX_BOUNTY_SUBMISSION_REJECTION_NOTE_LENGTH}
</span>
</div>
<div className="mt-2">
<textarea
id="rejectionNote"
{...register("rejectionNote", {
maxLength: 5000,
maxLength: MAX_BOUNTY_SUBMISSION_REJECTION_NOTE_LENGTH,
setValueAs: (value) => (value === "" ? undefined : value),
})}
rows={3}
maxLength={5000}
maxLength={MAX_BOUNTY_SUBMISSION_REJECTION_NOTE_LENGTH}
className={cn(
"block w-full rounded-md border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm",
errors.rejectionNote &&
Expand Down