feat: return mock users in makers tab, empty state for maker card

This commit is contained in:
MTG2000
2022-09-05 15:32:31 +03:00
parent e727cc6aa9
commit 086dac8715
4 changed files with 57 additions and 10 deletions

View File

@@ -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!
}

View File

@@ -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,
})
}
})
}