@campxdev/shared 1.11.31 → 1.11.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -26,13 +26,13 @@ const ExamGroupSelector = (props: ExamGroupSelectorProps) => {
|
|
|
26
26
|
const [prevExamType, setPrevExamType] = useState(null)
|
|
27
27
|
const [prevCourseId, setPrevCourseId] = useState(null)
|
|
28
28
|
let api =
|
|
29
|
-
filters
|
|
29
|
+
filters?.examType !== 'internal'
|
|
30
30
|
? '/exams/exams/exam-groups'
|
|
31
31
|
: '/exams/internal-exams'
|
|
32
32
|
const handleOpen = () => {
|
|
33
33
|
if (filters) {
|
|
34
34
|
if (
|
|
35
|
-
(filters
|
|
35
|
+
(filters?.examType && filters?.examType !== prevExamType) ||
|
|
36
36
|
(filters?.courseId && filters?.courseId !== prevCourseId)
|
|
37
37
|
) {
|
|
38
38
|
setOptions([])
|
|
@@ -46,12 +46,12 @@ const ExamGroupSelector = (props: ExamGroupSelectorProps) => {
|
|
|
46
46
|
})
|
|
47
47
|
.then((response) => {
|
|
48
48
|
setOptions(
|
|
49
|
-
filters
|
|
49
|
+
filters?.examType !== 'internal'
|
|
50
50
|
? response.data?.examGroups
|
|
51
51
|
: response.data?.exams,
|
|
52
52
|
)
|
|
53
|
-
setPrevExamType(filters
|
|
54
|
-
setPrevCourseId(filters
|
|
53
|
+
setPrevExamType(filters?.examType)
|
|
54
|
+
setPrevCourseId(filters?.courseId)
|
|
55
55
|
})
|
|
56
56
|
.catch((error) => {
|
|
57
57
|
console.error('Error fetching data from the API:', error)
|
|
@@ -80,7 +80,7 @@ const ExamGroupSelector = (props: ExamGroupSelectorProps) => {
|
|
|
80
80
|
...(allowAll ? [{ value: 'all', label: 'All' }] : []),
|
|
81
81
|
...options.map((item) => ({
|
|
82
82
|
label:
|
|
83
|
-
filters
|
|
83
|
+
filters?.examType != 'internal'
|
|
84
84
|
? item?.groupName
|
|
85
85
|
: item?.displayName,
|
|
86
86
|
value: item?.id,
|