-
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.
- Loading branch information
1 parent
ba5ebcb
commit 02060ef
Showing
43 changed files
with
1,597 additions
and
565 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
apps/api/src/modules/discussion/discussion-response.resolver.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,24 @@ | ||
import { | ||
ResolveField, | ||
Resolver, | ||
Root, | ||
} from '@nestjs/graphql' | ||
import { User } from '../user/types/user.model' | ||
import { PrismaService } from '@aelp-app/models' | ||
import { DiscussionResponce } from './types/discussion-responce.model' | ||
|
||
@Resolver(() => DiscussionResponce) | ||
export default class DiscussionResponseResolver { | ||
constructor( | ||
private prismaService: PrismaService | ||
) { } | ||
|
||
@ResolveField(() => User) | ||
async user(@Root() response: DiscussionResponce) { | ||
return this.prismaService.discussionResponce.findUnique({ | ||
where: { | ||
id: response.id, | ||
} | ||
}).user() | ||
} | ||
} |
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,14 @@ | ||
import { ModelsModule } from '@aelp-app/models' | ||
import { Module } from '@nestjs/common' | ||
import DiscussionResponseResolver from './discussion-response.resolver' | ||
import DiscussionResolver from './discussion.resolver' | ||
import DiscussionService from './discussion.service' | ||
|
||
@Module({ | ||
imports: [ModelsModule], | ||
providers: [ | ||
DiscussionResolver, | ||
DiscussionService, | ||
DiscussionService, DiscussionResponseResolver | ||
], | ||
}) | ||
export default class DiscussionModule {} | ||
export default class DiscussionModule { } |
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
33 changes: 33 additions & 0 deletions
33
apps/api/src/modules/discussion/types/discussion-responce.model.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,33 @@ | ||
import { Field } from '@nestjs/graphql'; | ||
import { ObjectType } from '@nestjs/graphql'; | ||
import { ID } from '@nestjs/graphql'; | ||
import { User } from '../../user/types/user.model'; | ||
import { Discussion } from './discussion.model'; | ||
|
||
@ObjectType() | ||
export class DiscussionResponce { | ||
|
||
@Field(() => ID, { nullable: false }) | ||
id!: string; | ||
|
||
@Field(() => User, { nullable: false }) | ||
user?: User; | ||
|
||
@Field(() => String, { nullable: false }) | ||
discussionId!: string; | ||
|
||
@Field(() => String, { nullable: false }) | ||
responce!: string; | ||
|
||
@Field(() => Date, { nullable: false }) | ||
updatedAt!: Date; | ||
|
||
@Field(() => Date, { nullable: false }) | ||
createdAt!: Date; | ||
|
||
@Field(() => Discussion, { nullable: false }) | ||
discussion?: Discussion; | ||
|
||
@Field(() => String, { nullable: false }) | ||
userId!: string; | ||
} |
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
100 changes: 0 additions & 100 deletions
100
apps/frontend/components/organisms/question-card/question-card.tsx
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
Oops, something went wrong.