Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #487

Merged
merged 43 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c93876d
session schema changes and migrations added
VISHNUDAS-tunerlabs Jan 8, 2024
c945450
duplicate migration removed
VISHNUDAS-tunerlabs Jan 8, 2024
aa053a4
test
VISHNUDAS-tunerlabs Jan 8, 2024
e87f1cf
test removed
VISHNUDAS-tunerlabs Jan 8, 2024
657481a
migration,session model change, validator updated, queries added
VISHNUDAS-tunerlabs Jan 8, 2024
75e423c
addMentee api, create(aM), removeMentee, migrations
VISHNUDAS-tunerlabs Jan 10, 2024
5e21290
migration and notification update, session/create changes
VISHNUDAS-tunerlabs Jan 12, 2024
e27f573
session/Delete changes
VISHNUDAS-tunerlabs Jan 12, 2024
c508724
started on update API
VISHNUDAS-tunerlabs Jan 16, 2024
0a28cec
session fn changes update pending
VISHNUDAS-tunerlabs Jan 16, 2024
4fcf82a
added enrolledMentees list api
nevil-mathew Jan 16, 2024
30ae915
updated response messages
nevil-mathew Jan 16, 2024
68f142e
Public sessions are searchable by mentee/mentor #1061 + FE requested…
adithyadinesh0412 Jan 16, 2024
19563d9
updated list api
nevil-mathew Jan 16, 2024
dec9d10
comment resolves + update api changes
VISHNUDAS-tunerlabs Jan 16, 2024
f1e1164
Public sessions are searchable by mentee/mentor #1061 review comments
adithyadinesh0412 Jan 16, 2024
dea312f
delete notification template selection change
VISHNUDAS-tunerlabs Jan 17, 2024
2147c03
Merge pull request #476 from adithyadinesh0412/develop
rakeshSgr Jan 17, 2024
7163b74
added session validation to enrolledMentees
nevil-mathew Jan 17, 2024
2a92e94
resolved postman collection conflict
nevil-mathew Jan 17, 2024
91193e0
Merge branch 'develop' into enrolledMentees-api
nevil-mathew Jan 17, 2024
4f69303
changes in migration script to add notification template. merged old …
VISHNUDAS-tunerlabs Jan 17, 2024
5806f91
updated user queries
nevil-mathew Jan 17, 2024
f509150
Merge pull request #475 from ELEVATE-Project/enrolledMentees-api
rakeshSgr Jan 17, 2024
c395918
optimised the migration script
VISHNUDAS-tunerlabs Jan 17, 2024
b80d3ec
optimised the migration script
VISHNUDAS-tunerlabs Jan 17, 2024
0e30a70
fixed an issue with session create api
nevil-mathew Jan 17, 2024
5a0d98c
session create bug fix
VISHNUDAS-tunerlabs Jan 17, 2024
84fb77b
mentee mentor list qa issue fix
adithyadinesh0412 Jan 17, 2024
818a64a
Merge pull request #478 from adithyadinesh0412/develop
rakeshSgr Jan 17, 2024
5936a46
Merge pull request #477 from ELEVATE-Project/create-session-fix
rakeshSgr Jan 17, 2024
d3e17ec
mentee mentor list qa issue fix
adithyadinesh0412 Jan 17, 2024
b2354da
Merge pull request #479 from adithyadinesh0412/develop
aks30 Jan 17, 2024
f0159ce
convert body.type to upper case
VISHNUDAS-tunerlabs Jan 18, 2024
94a6adb
Merge branch 'develop' into addMenteeToSession
VISHNUDAS-tunerlabs Jan 18, 2024
6ef655c
updated migration script
VISHNUDAS-tunerlabs Jan 18, 2024
bfa5126
Merge pull request #474 from ELEVATE-Project/addMenteeToSession
rakeshSgr Jan 18, 2024
fb65cd3
duplicate migrationfile removed
VISHNUDAS-tunerlabs Jan 18, 2024
7744ef8
Merge pull request #483 from ELEVATE-Project/addMenteeToSession
rakeshSgr Jan 18, 2024
cd2afb6
change in way of import and added missed code due to merge conflict r…
VISHNUDAS-tunerlabs Jan 18, 2024
0f56977
Merge pull request #484 from ELEVATE-Project/addMenteeToSession
rakeshSgr Jan 18, 2024
1b2585f
Modified Validator
joffinjoy Jan 18, 2024
ca6ed33
Merge pull request #486 from ELEVATE-Project/validation-fix
aks30 Jan 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added session validation to enrolledMentees
  • Loading branch information
nevil-mathew committed Jan 17, 2024
commit 7163b74706760d4e8f9864cdad8804a0328ed7f0
2 changes: 1 addition & 1 deletion src/controllers/v1/sessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ module.exports = class Sessions {

async enrolledMentees(req) {
try {
return await sessionService.enrolledMentees(req.params.id, req.query)
return await sessionService.enrolledMentees(req.params.id, req.query, req.decodedToken.id)
} catch (error) {
throw error
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/mentees.js
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ module.exports = class MenteesHelper {
userDetails.data.result.count = userDetails.data.result.count

if (queryParams.session_id) {
const enrolledMentees = await sessionService.enrolledMentees(queryParams.session_id)
const enrolledMentees = await sessionService.enrolledMentees(queryParams.session_id, '', userId)
const enrolledMenteeIds = enrolledMentees.result.map((enrolledMentee) => enrolledMentee.id)

userDetails.data.result.data.forEach((user) => {
Expand Down
13 changes: 12 additions & 1 deletion src/services/sessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1708,8 +1708,19 @@ module.exports = class SessionsHelper {
* @returns {Object} - Success response with details of enrolled mentees.
* @throws {Error} - Throws an error if there's an issue during data retrieval.
*/
static async enrolledMentees(sessionId, queryParams) {
static async enrolledMentees(sessionId, queryParams, userID) {
try {
const session = await sessionQueries.findOne({
id: sessionId,
[Op.or]: [{ mentor_id: userID }, { created_by: userID }],
})
if (!session) {
return common.failureResponse({
message: 'SESSION_NOT_FOUND',
statusCode: httpStatusCode.bad_request,
responseCode: 'CLIENT_ERROR',
})
}
const mentees = await sessionAttendeesQueries.findAll({ session_id: sessionId })
const menteeIds = mentees.map((mentee) => mentee.mentee_id)

Expand Down