Skip to content

Commit b605605

Browse files
fixbug add students
1 parent 4477016 commit b605605

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
{{ messageText }}
1919
<template #action="{ attrs }">
2020
<v-btn
21-
color="black"
21+
color="white"
2222
text
2323
icon
2424
v-bind="attrs"

src/store/classroom.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,10 @@ export const classroom: Module<ClassroomState, RootState> = {
123123
commit('REMOVE_CLASSROOM', pk)
124124
},
125125

126-
async addStudents ({ state, commit }, payload: AddStudentReq[]): Promise<void> {
126+
async addStudents ({ state, dispatch }, payload: AddStudentReq[]): Promise<void> {
127127
if (state.currentClassroom === undefined) return
128128
await Api.classroom.addStudents(state.currentClassroom.pk, payload)
129-
payload.forEach(student => {
130-
commit('ADD_STUDENT_TO_CURRENT_CLASSROOM', student)
131-
})
129+
await dispatch('detail', state.currentClassroom.pk)
132130
},
133131

134132
async removeStudents ({ state, commit }, payload: RemoveStudentReq[]): Promise<void> {

src/views/classroom/ClassroomList.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
class="mt-5"
2525
></v-progress-circular>
2626

27-
<p v-else-if="noClassrooms" v-text="'You don\'t have any classroom yet.'" />
27+
<p
28+
v-else-if="noClassrooms"
29+
class="mt-3"
30+
v-text="'You don\'t have any classroom yet.'"
31+
/>
2832

2933
<v-card
3034
v-else

src/views/reading-exercise/ReadingExerciseCreate.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
color="primary"
3535
:loading="loading"
3636
@click="save"
37+
min-width="110"
3738
>
3839
Save
3940
</v-btn>

src/views/reading-exercise/ReadingExerciseList.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
class="mt-5"
2525
></v-progress-circular>
2626

27-
<p v-else-if="noExercises" v-text="'You don\'t have any exercises yet.'" />
27+
<p
28+
v-else-if="noExercises"
29+
class="mt-3"
30+
v-text="'You don\'t have any exercises yet.'"
31+
/>
2832

2933
<v-card
3034
v-else

0 commit comments

Comments
 (0)