mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-23 00:04:20 +01:00
feat: add api query to get tournament open for registeration
This commit is contained in:
@@ -613,6 +613,7 @@ export interface NexusGenFieldTypes {
|
||||
getProject: NexusGenRootTypes['Project']; // Project!
|
||||
getProjectsInTournament: NexusGenRootTypes['TournamentProjectsResponse']; // TournamentProjectsResponse!
|
||||
getTournamentById: NexusGenRootTypes['Tournament']; // Tournament!
|
||||
getTournamentToRegister: NexusGenRootTypes['Tournament'][]; // [Tournament!]!
|
||||
getTrendingPosts: NexusGenRootTypes['Post'][]; // [Post!]!
|
||||
hottestProjects: NexusGenRootTypes['Project'][]; // [Project!]!
|
||||
me: NexusGenRootTypes['MyProfile'] | null; // MyProfile
|
||||
@@ -996,6 +997,7 @@ export interface NexusGenFieldTypeNames {
|
||||
getProject: 'Project'
|
||||
getProjectsInTournament: 'TournamentProjectsResponse'
|
||||
getTournamentById: 'Tournament'
|
||||
getTournamentToRegister: 'Tournament'
|
||||
getTrendingPosts: 'Post'
|
||||
hottestProjects: 'Project'
|
||||
me: 'MyProfile'
|
||||
|
||||
@@ -333,6 +333,7 @@ type Query {
|
||||
getProject(id: Int!): Project!
|
||||
getProjectsInTournament(roleId: Int, search: String, skip: Int = 0, take: Int = 10, tournamentId: Int!): TournamentProjectsResponse!
|
||||
getTournamentById(id: Int!): Tournament!
|
||||
getTournamentToRegister: [Tournament!]!
|
||||
getTrendingPosts: [Post!]!
|
||||
hottestProjects(skip: Int = 0, take: Int = 50): [Project!]!
|
||||
me: MyProfile
|
||||
|
||||
@@ -214,6 +214,28 @@ const getTournamentById = extendType({
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const getTournamentToRegister = extendType({
|
||||
type: "Query",
|
||||
definition(t) {
|
||||
t.nonNull.list.nonNull.field('getTournamentToRegister', {
|
||||
type: Tournament,
|
||||
args: {
|
||||
},
|
||||
resolve() {
|
||||
|
||||
return prisma.tournament.findMany({
|
||||
where: {
|
||||
end_date: {
|
||||
gt: new Date()
|
||||
},
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
const ParticipationInfo = objectType({
|
||||
name: "ParticipationInfo",
|
||||
definition(t) {
|
||||
@@ -538,6 +560,7 @@ module.exports = {
|
||||
getMakersInTournament,
|
||||
getProjectsInTournament,
|
||||
tournamentParticipationInfo,
|
||||
getTournamentToRegister,
|
||||
|
||||
// Mutations
|
||||
registerInTournament,
|
||||
|
||||
Reference in New Issue
Block a user