(courseId)
| 285 | }; |
| 286 | |
| 287 | const loadCourse = async (courseId) => { |
| 288 | const query = ` |
| 289 | query { |
| 290 | course: getCourse(id: "${courseId}") { |
| 291 | title, |
| 292 | cost, |
| 293 | published, |
| 294 | privacy, |
| 295 | isBlog, |
| 296 | description, |
| 297 | featuredImage, |
| 298 | id, |
| 299 | lessons { |
| 300 | id, |
| 301 | title |
| 302 | }, |
| 303 | isFeatured, |
| 304 | slug, |
| 305 | courseId |
| 306 | } |
| 307 | } |
| 308 | `; |
| 309 | |
| 310 | try { |
| 311 | const response = await executeGQLCall(query); |
| 312 | if (response.course) { |
| 313 | setCourseDataWithDescription(response.course); |
| 314 | } |
| 315 | } catch (err) { |
| 316 | setError(err.message); |
| 317 | } |
| 318 | }; |
| 319 | |
| 320 | const onFeaturedImageSelection = (url) => |
| 321 | changeCourseDetails("featuredImage", url); |
no test coverage detected