-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix minor bugs in contest page and api (#1349)
* fix(be): return contest problems in order * fix(be): connect announcement to contest * fix(be): get announcements by contest id * test(be): add missing test for announcement controller * fix(fe): show related problem in announcement page * 연결된 problem이 존재할 경우 problem id를 표시합니다. * announcement 작성 시각을 분 단위까지만 표기합니다. * fix(fe): show alphabetical problem id in contest problem list * fix(fe): rename clarification into announcement * chore(fe): show accepted rate with fixing-point notation of two digits * feat(fe): remove card list if no data is found
- Loading branch information
Showing
23 changed files
with
208 additions
and
229 deletions.
There are no files selected for viewing
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
25 changes: 25 additions & 0 deletions
25
backend/apps/client/src/announcement/announcement.controller.spec.ts
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,25 @@ | ||
import { Test, type TestingModule } from '@nestjs/testing' | ||
import { expect } from 'chai' | ||
import { RolesService } from '@libs/auth' | ||
import { AnnouncementController } from './announcement.controller' | ||
import { AnnouncementService } from './announcement.service' | ||
|
||
describe('AnnouncementController', () => { | ||
let controller: AnnouncementController | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [AnnouncementController], | ||
providers: [ | ||
{ provide: AnnouncementService, useValue: {} }, | ||
{ provide: RolesService, useValue: {} } | ||
] | ||
}).compile() | ||
|
||
controller = module.get<AnnouncementController>(AnnouncementController) | ||
}) | ||
|
||
it('should be defined', () => { | ||
expect(controller).to.be.ok | ||
}) | ||
}) |
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
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
18 changes: 18 additions & 0 deletions
18
backend/prisma/migrations/20240207142636_connect_announcement_to_contest/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,18 @@ | ||
/* | ||
Warnings: | ||
- Added the required column `contest_id` to the `announcement` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "announcement" DROP CONSTRAINT "announcement_problem_id_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "announcement" ADD COLUMN "contest_id" INTEGER NOT NULL, | ||
ALTER COLUMN "problem_id" DROP NOT NULL; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "announcement" ADD CONSTRAINT "announcement_contest_id_fkey" FOREIGN KEY ("contest_id") REFERENCES "contest"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "announcement" ADD CONSTRAINT "announcement_problem_id_fkey" FOREIGN KEY ("problem_id") REFERENCES "problem"("id") ON DELETE SET NULL ON UPDATE CASCADE; |
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.