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

Feat/#166 #179

Merged
merged 70 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
7a35ba6
fix: remove unused validate
nc-minh Feb 27, 2023
dec6c5a
fix: add subject into userExam
nc-minh Feb 27, 2023
649917b
Merge branch 'master' into dev
nc-minh Feb 27, 2023
956f107
feat: create api get all documents by subjectId
nc-minh Feb 28, 2023
41bfadf
fix: remove validation for author field in DocumentDto
nc-minh Feb 28, 2023
a8269b5
fix: update response of verifyAccessToken
nc-minh Feb 28, 2023
9feca53
fix: update response of verifyAccessToken
nc-minh Feb 28, 2023
f4fe5d0
fix: add userInfo into response refreshToken
nc-minh Feb 28, 2023
f65efb3
fix: add subject to response of getDocumentBySubject api
nc-minh Mar 1, 2023
c7b16bf
fix: resolve conflict
nc-minh Mar 1, 2023
d1a4c52
feat: create api get a subject by id
nc-minh Mar 1, 2023
a6e6332
feat: create unique for subject_name
nc-minh Mar 3, 2023
e3ec0c7
fix: return code and message error when create duplicate subject
nc-minh Mar 3, 2023
8006504
feat: update auth api for the admin
nc-minh Mar 10, 2023
b3e9b7f
fix: refreshToken response
nc-minh Mar 13, 2023
c3f329b
feat: [update api approve subject]
nc-minh Mar 14, 2023
4382fb9
fix: resolve conflict
nc-minh Mar 14, 2023
07f71df
fix: error response
nc-minh Mar 14, 2023
895bb07
fix: [TOKEN_EXPIRED response]
nc-minh Mar 14, 2023
7ec732a
fix: [resolve conflict]
nc-minh Mar 14, 2023
2c8973f
feat: [add api update is_approved for admin]
nc-minh Mar 14, 2023
3e901d5
feat: api create new document for admin
nc-minh Mar 15, 2023
4e3c1f5
fix: resolve conflict
nc-minh Mar 15, 2023
34050f5
feat: [Pagination for all of api get all]
nc-minh Mar 16, 2023
86d790f
fix: resolve conflict
nc-minh Mar 16, 2023
4545601
feat: [update metadata(total, currentPage, pageSize) in response]
nc-minh Mar 16, 2023
41dce68
fix: [resolve conflict]
nc-minh Mar 16, 2023
c652694
fix: [resolve conflict]
nc-minh Mar 16, 2023
d0a5fc3
fix: [resolve conflict]
nc-minh Mar 16, 2023
b09dd5a
fix: [resolve conflict]
nc-minh Mar 16, 2023
54f0aa0
feat: [default sort with desc]
nc-minh Mar 16, 2023
bbfa4db
feat/#135 (#136)
locxuandao Mar 18, 2023
a2ee5e1
feat/#138 (#139)
locxuandao Mar 18, 2023
4d0b325
feat: allow users outside the organization
nc-minh Mar 19, 2023
7878433
Merge branch 'master' into dev
nc-minh Mar 19, 2023
6f1f5a3
fix: typo
nc-minh Mar 19, 2023
2e19ed0
Merge branch 'master' into dev
nc-minh Mar 19, 2023
0af57e0
feat: softDelete
nc-minh Mar 19, 2023
ca80a0d
feat: [delete plugin]
nc-minh Mar 20, 2023
61c9be4
feat: [api update document & exam by admin and own]
nc-minh Mar 21, 2023
725f9f9
feat: [Update api documentation and exam by admin and owner]
nc-minh Mar 21, 2023
496380f
fix: resolve conflict
nc-minh Mar 21, 2023
c7cf17f
feat: [...]
nc-minh Mar 22, 2023
818e7de
feat: [:boom:][change the structure, logic, algorithms related to use…
nc-minh Mar 22, 2023
60d8a8e
fix: [:x:][resolve conflict]
nc-minh Mar 22, 2023
ba26cc6
Merge branch 'master' into dev
nc-minh Mar 23, 2023
273b295
feat: [...]
nc-minh Mar 23, 2023
2a57789
feat: [test workflows]
nc-minh Mar 23, 2023
2c52cbf
feat: [test workflows]
nc-minh Mar 23, 2023
e47865a
feat: [test workflows]
nc-minh Mar 23, 2023
3731630
feat: [:zap:][add is_show_info & nickname to user and handle hide use…
nc-minh Mar 24, 2023
a1170ff
fix: [convert pageSize & currentPage from string to number in pipeline]
nc-minh Mar 24, 2023
4cb5e69
fix: [change Dockfile]
nc-minh Mar 24, 2023
bb6b28e
fix: [resolve conflict]
nc-minh Mar 24, 2023
4f61a3c
fix: [author array to object in response]
nc-minh Mar 24, 2023
9408ed6
feat: [...]
nc-minh Mar 24, 2023
64499ef
feat/#146 (#151)
DungNguyen2003 Mar 27, 2023
306c3c2
feat: [add questions into response of draft exam]
nc-minh Mar 27, 2023
dfce741
fix: return wrong hideUserInfoIfRequired
nc-minh Mar 27, 2023
32c8d7b
fix: [resolve conflict]
nc-minh Mar 27, 2023
4e1daec
fix: missing hideUserInfoIfRequired() in GetAllDocumentByAdmin()
nc-minh Mar 27, 2023
7a44d00
feat/#155 (#156)
locxuandao Mar 27, 2023
ae35ee7
fix: resolve conflict
nc-minh Mar 30, 2023
9cbe07f
feat/#160 (#161)
locxuandao Apr 6, 2023
e41f4d1
Feat/#162 (#163)
locxuandao Apr 11, 2023
72efd61
fix: [conflicts]
DungNguyen2003 Apr 18, 2023
c257717
fix: [empty]
DungNguyen2003 Apr 18, 2023
f974b42
feat/#166
DungNguyen2003 Apr 20, 2023
569ffe8
feat/#166 [fix result response of api userExam]
DungNguyen2003 Apr 21, 2023
9867058
feat/#166
DungNguyen2003 Apr 21, 2023
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
1 change: 1 addition & 0 deletions src/apis/v1/exam/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export const getExamById = async (id: string, userRank: string, userEmail: strin
title: 1,
description: 1,
is_approved: 1,
school_year: 1,
author: {
_id: '$author._id',
fullname: '$author.fullname',
Expand Down
28 changes: 28 additions & 0 deletions src/apis/v1/userExam/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,14 @@ export const getAllUserExamsByOwner = async (userId: string, filter: UserExamFil
as: 'subject',
},
},
{
$lookup: {
from: 'user_answer',
localField: 'user_answer_id',
foreignField: '_id',
as: 'user_answers',
},
},
{
$unwind: '$subject',
},
Expand Down Expand Up @@ -279,6 +287,22 @@ export const getUserExamByOwner = async (userEmail: string, userExamId: string)
as: 'author',
},
},
{
$lookup: {
from: 'exam',
localField: 'original_exam',
foreignField: '_id',
as: 'exam',
},
},
{
$lookup: {
from: 'user',
localField: 'exam.author',
foreignField: '_id',
as: 'author_exam',
},
},
{
$lookup: {
from: 'subject',
Expand Down Expand Up @@ -311,6 +335,7 @@ export const getUserExamByOwner = async (userEmail: string, userExamId: string)
'questions.author': 0,
'user_answers.is_deleted': 0,
'user_answers.deleted_at': 0,
exam: 0,
},
},
];
Expand Down Expand Up @@ -346,9 +371,12 @@ export const getUserExamByOwner = async (userEmail: string, userExamId: string)
return {
answers: question?.answers,
content: question?.content,
image: question?.image,
accuracy: question?.accuracy,
_id: question._id,
};
}),
author_exam: hideUserInfoIfRequired(userExam[0]?.author_exam[0]),
author: hideUserInfoIfRequired(userExam[0]?.author),
};
} catch (error) {
Expand Down