-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from MinaFoundation/feature/discord-username-p…
…roposal Feature/discord username proposal
- Loading branch information
Showing
16 changed files
with
1,371 additions
and
23 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
prisma/migrations/20250107192103_add_mef_id_to_funding_round/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.