diff --git a/api/functions/graphql/nexus-typegen.ts b/api/functions/graphql/nexus-typegen.ts index d5efd5f..4161f06 100644 --- a/api/functions/graphql/nexus-typegen.ts +++ b/api/functions/graphql/nexus-typegen.ts @@ -203,7 +203,6 @@ export interface NexusGenObjects { lnurl_callback_url?: string | null; // String screenshots: string[]; // [String!]! thumbnail_image: string; // String! - title: string; // String! votes_count: number; // Int! website: string; // String! } diff --git a/api/functions/graphql/types/tournament.js b/api/functions/graphql/types/tournament.js index f9b400a..a69484f 100644 --- a/api/functions/graphql/types/tournament.js +++ b/api/functions/graphql/types/tournament.js @@ -115,8 +115,44 @@ const getMakersInTournament = extendType({ search: stringArg(), roleId: intArg(), }, - resolve(_, { tournamentId }) { - return [] + resolve(_, args) { + + + let filters = []; + + if (args.search) filters.push({ + OR: [ + { + name: { + contains: args.search, + mode: 'insensitive' + }, + jobTitle: { + contains: args.search, + mode: 'insensitive' + } + } + ] + }) + + if (args.roleId) filters.push({ + roles: { + some: { + roleId: args.roleId + } + } + }) + + + return prisma.user.findMany({ + ...(filters.length > 0 && { + where: { + AND: filters + } + }), + skip: args.skip, + take: args.take, + }) } }) } diff --git a/src/features/Tournaments/pages/MakersPage/MakerCard/MakerCard.tsx b/src/features/Tournaments/pages/MakersPage/MakerCard/MakerCard.tsx index 1f21365..3ab8a55 100644 --- a/src/features/Tournaments/pages/MakersPage/MakerCard/MakerCard.tsx +++ b/src/features/Tournaments/pages/MakersPage/MakerCard/MakerCard.tsx @@ -33,27 +33,39 @@ export default function MakerCard({ maker, isMe }: Props) {
{maker.name}
-{maker.jobTitle}
-{maker.jobTitle}
+ : +No job title
} + {maker.roles.length ?No roles added
+ }🌈 Roles
-🌈 Roles
+ + {maker.roles.length ?No roles added
+ }🛠️ Skills
-🛠️ Skills
+ {maker.skills.length ?No skills added
+ }