-
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.
Merge branch 'main' into 1047-implement-admin-announcement-module
- Loading branch information
Showing
175 changed files
with
5,447 additions
and
3,518 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
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 was deleted.
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
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ node_modules/ | |
pnpm-lock.yaml | ||
.pnpm-store/ | ||
@generated/ | ||
__generated__/ | ||
schema.gql | ||
collection/ | ||
.next/ | ||
|
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
{ | ||
"recommendations": ["ms-vscode-remote.remote-containers"] | ||
// Recommendations for Frontend team, developing without devcontainer | ||
"recommendations": [ | ||
"apollographql.vscode-apollo", | ||
"dbaeumer.vscode-eslint", | ||
"donjayamanne.githistory", | ||
"eamodio.gitlens", | ||
"EditorConfig.EditorConfig", | ||
"esbenp.prettier-vscode" | ||
] | ||
} |
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,10 @@ | ||
module.exports = { | ||
client: { | ||
includes: ['./frontend-client/**/*.ts', './frontend-client/**/*.tsx'], | ||
excludes: ['**/__generated__/**'], | ||
service: { | ||
name: 'codedang-graphql-app', | ||
url: 'https://dev.codedang.com/graphql' | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
import { Field, InputType, Int } from '@nestjs/graphql' | ||
|
||
@InputType() | ||
export class Testcase { | ||
export class Sample { | ||
@Field(() => String, { nullable: false }) | ||
input!: string | ||
|
||
@Field(() => String, { nullable: false }) | ||
output!: string | ||
} | ||
|
||
@InputType() | ||
export class Testcase extends Sample { | ||
@Field(() => Int, { nullable: true }) | ||
scoreWeight?: number | ||
} |
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,38 @@ | ||
import { InternalServerErrorException, Logger } from '@nestjs/common' | ||
import { Query, Resolver, ResolveField, Parent } from '@nestjs/graphql' | ||
import { ProblemTag, Tag } from '@generated' | ||
import { ProblemService } from './problem.service' | ||
|
||
@Resolver(() => ProblemTag) | ||
export class ProblemTagResolver { | ||
private readonly logger = new Logger(ProblemTagResolver.name) | ||
|
||
constructor(private readonly problemService: ProblemService) {} | ||
|
||
@ResolveField('tag', () => Tag) | ||
async getTag(@Parent() problemTag: ProblemTag) { | ||
try { | ||
return await this.problemService.getTag(problemTag.tagId) | ||
} catch (error) { | ||
this.logger.error(error) | ||
throw new InternalServerErrorException() | ||
} | ||
} | ||
} | ||
|
||
@Resolver(() => Tag) | ||
export class TagResolver { | ||
private readonly logger = new Logger(TagResolver.name) | ||
|
||
constructor(private readonly problemService: ProblemService) {} | ||
|
||
@Query(() => [Tag]) | ||
async getTags() { | ||
try { | ||
return await this.problemService.getTags() | ||
} catch (error) { | ||
this.logger.error(error) | ||
throw new InternalServerErrorException() | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import { Module } from '@nestjs/common' | ||
import { StorageModule } from '@admin/storage/storage.module' | ||
import { ProblemTagResolver, TagResolver } from './problem-tag.resolver' | ||
import { ProblemResolver } from './problem.resolver' | ||
import { ProblemService } from './problem.service' | ||
|
||
@Module({ | ||
imports: [StorageModule], | ||
providers: [ProblemResolver, ProblemService] | ||
providers: [ProblemResolver, ProblemTagResolver, TagResolver, ProblemService] | ||
}) | ||
export class ProblemModule {} |
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.