import { Course, CourseCategory, CourseChapter, UserInstructor } from 'wasp/entities'
import { type GetCourseCategories, type GetUserInstructors, type GetCourses, type GetCourseChapters } from 'wasp/server/operations'
// ... other code
export const getUserInstructors: GetUserInstructors<void, UserInstructor[]> = async (args, context) => {
return context.entities.UserInstructor.findMany({
orderBy: { id: 'asc' },
include: {
user: {
select: {
id: true,
username: true
}
}
},
})
}
import { Course, CourseCategory, CourseChapter, UserInstructor } from 'wasp/entities'
import { type GetCourseCategories, type GetUserInstructors, type GetCourses, type GetCourseChapters } from 'wasp/server/operations'
// ... other code
export const getUserInstructors: GetUserInstructors<void, UserInstructor[]> = async (args, context) => {
return context.entities.UserInstructor.findMany({
orderBy: { id: 'asc' },
include: {
user: {
select: {
id: true,
username: true
}
}
},
})
}