Skip to content

Commit

Permalink
Merge pull request #99 from MinaFoundation/feature/discord-username-p…
Browse files Browse the repository at this point in the history
…roposal

Feature/discord username proposal
  • Loading branch information
iluxonchik authored Jan 7, 2025
2 parents bce49ac + 51b302c commit 9774f54
Show file tree
Hide file tree
Showing 16 changed files with 1,371 additions and 23 deletions.
142 changes: 140 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pgt-web-app",
"version": "0.1.29",
"version": "0.1.30",
"private": true,
"type": "module",
"scripts": {
Expand Down Expand Up @@ -47,6 +47,7 @@
"decimal.js": "^10.4.3",
"discord.js": "^14.16.3",
"dotenv": "^16.4.5",
"framer-motion": "^11.15.0",
"hash-wasm": "^4.11.0",
"jose": "^5.9.6",
"loglevel": "^1.9.2",
Expand All @@ -58,6 +59,9 @@
"next-themes": "^0.3.0",
"react": "18.3.1",
"react-day-picker": "^8.10.1",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dnd-touch-backend": "^16.0.1",
"react-dom": "18.3.1",
"tailwind-merge": "^2.5.4",
"tailwindcss-animate": "^1.0.7",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
Warnings:
- A unique constraint covering the columns `[mefId]` on the table `FundingRound` will be added. If there are existing duplicate values, this will fail.
*/
-- AlterTable
ALTER TABLE "FundingRound" ADD COLUMN "mefId" SERIAL NOT NULL;

-- CreateIndex
CREATE UNIQUE INDEX "FundingRound_mefId_key" ON "FundingRound"("mefId");
1 change: 1 addition & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ model TopicReviewerGroup {

model FundingRound {
id String @id @default(uuid()) @db.Uuid
mefId Int @default(autoincrement()) @unique
createdById String @db.Uuid
topicId String @db.Uuid
name String @db.VarChar(100)
Expand Down
22 changes: 22 additions & 0 deletions src/app/api/voting/ranked/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { NextRequest } from 'next/server';
import { ApiResponse } from '@/lib/api-response';
import { AppError } from '@/lib/errors';
import { prisma } from '@/lib/prisma';
import { GetRankedEligibleProposalsAPIResponse, RankedVotingService } from '@/services/RankedVotingService';

export async function GET(request: NextRequest) {
try {
const fundingRoundId = request.nextUrl.searchParams.get('fundingRoundId');

if (!fundingRoundId) {
throw new AppError('Funding round ID is required', 400);
}

const rankedVotingService = new RankedVotingService(prisma);
const result: GetRankedEligibleProposalsAPIResponse = await rankedVotingService.getEligibleProposals(fundingRoundId);

return ApiResponse.success(result);
} catch (error) {
return ApiResponse.error(error);
}
}
5 changes: 4 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ export default function HomePage() {
fundingRoundName={selectedRound.name}
/>;
case 'vote':
return <VotingPhase />;
return <VotingPhase
fundingRoundId={selectedRound.id}
fundingRoundName={selectedRound.name}
/>;
case 'completed':
return <CompletedPhase />;
default:
Expand Down
Loading

0 comments on commit 9774f54

Please sign in to comment.