()
| 244 | }; |
| 245 | |
| 246 | const onCourseDelete = async () => { |
| 247 | const query = ` |
| 248 | mutation { |
| 249 | result: deleteCourse(id: "${courseData.course.id}") |
| 250 | } |
| 251 | `; |
| 252 | |
| 253 | try { |
| 254 | props.dispatch(networkAction(true)); |
| 255 | const response = await queryGraphQL( |
| 256 | `${BACKEND}/graph`, |
| 257 | query, |
| 258 | props.auth.token |
| 259 | ); |
| 260 | |
| 261 | if (response.result) { |
| 262 | setCourseData( |
| 263 | Object.assign({}, courseData, { |
| 264 | course: initCourseMetaData, |
| 265 | }) |
| 266 | ); |
| 267 | props.closeEditor(); |
| 268 | } |
| 269 | } catch (err) { |
| 270 | setError(err.message); |
| 271 | } finally { |
| 272 | props.dispatch(networkAction(false)); |
| 273 | } |
| 274 | }; |
| 275 | |
| 276 | const setCourseDataWithDescription = (course) => { |
| 277 | setCourseData( |
nothing calls this directly
no test coverage detected