File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/client/components/Courses/Course Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -114,11 +114,27 @@ const Course = () => {
114
114
refetchCourse ( )
115
115
}
116
116
}
117
+ const isAlreadyAssigned = ( user : User ) => {
118
+ const existsAlready : Responsebility | undefined = chatInstance . responsibilities . find ( ( r : Responsebility ) => { return r . user . id === user . id } )
119
+ console . log ( chatInstance . responsibilities )
120
+ console . log ( user )
121
+ console . log ( existsAlready )
122
+ return existsAlready != undefined
123
+ }
124
+
117
125
const drawActionComponent = ( user : User ) => {
126
+ const isResponsible = isAlreadyAssigned ( user )
118
127
return (
128
+ < >
129
+ { ! isResponsible ?
119
130
< Button onClick = { ( ) => handleAddResponsible ( user ) } >
120
131
{ t ( 'course:add' ) }
132
+
121
133
</ Button >
134
+ :
135
+ < Typography > vastuussa</ Typography >
136
+ }
137
+ </ >
122
138
)
123
139
}
124
140
const handleRemoveResponsibility = async ( responsibility ) => {
You can’t perform that action at this time.
0 commit comments