Open amos1969 opened 1 hour ago
After deliberations with front-end, they want more user data in the responses from the cohort endpoints.
What needs to be done is to include them when querying the database:
const cohorts = await dbClient.cohort.findMany({ include: { users: { select: { id: true, role: true, email: true, profile: { select: { firstName: true, lastName: true, bio: true, githubUrl: true } } } } } })
Also in the /cohorts/addUser should return more data:
const user = await dbClient.user.update({ where: { id: userId }, data: { cohorts: { connect: { id: cohortId } } }, select: { id: true, role: true, email: true, profile: { select: { firstName: true, lastName: true, bio: true, githubUrl: true } } } })
Approved
After deliberations with front-end, they want more user data in the responses from the cohort endpoints.
What needs to be done is to include them when querying the database:
Also in the /cohorts/addUser should return more data: