Ready to get started?

Join Adocasts Plus for $8.00/mo, or sign into your account to get access to all of our lessons.

robot mascot smiling

Creating A New Course

In this lesson, we'll add the ability to create a new course within the active organization.

Published
Nov 27, 24
Duration
14m 2s

Developer, dog lover, and burrito eater. Currently teaching AdonisJS, a fully featured NodeJS framework, and running Adocasts where I post new lessons weekly. Professionally, I work with JavaScript, .Net C#, and SQL Server.

Adocasts

Burlington, KY

Chapters

00:00 - Creating the CourseActions Component
03:42 - Exposing Methods Outside of the CourseActions Component
06:30 - Using our CourseActions Component
06:59 - Testing the CourseActions Component
07:10 - Preloading Statuses, Access Levels, & Difficulties on the Org
07:56 - Course Store Validation
09:10 - The Store Course Action
10:31 - Courses Store Route Handler
11:21 - Defining the Courses Store Route
11:36 - Ordering the Org Preloads
11:56 - Testing & Debugging a NaN Error on our Course Store

Ready to get started?

Join Adocasts Plus for $8.00/mo, or sign into your account to get access to all of our lessons.

Join The Discussion! (3 Comments)

Please sign in or sign up for free to join in on the dicussion.

  1. Commented 5 days ago

    Hello,

    With useTemplateRef, I’m encountering type errors with TypeScript because the component is of type unknown. I also believe this issue is caused by unplugin-vue-components. All auto-imported components are of type unknown, and VSCode doesn’t provide IntelliSense for these components (e.g., their attributes). However, if I manually import the components, everything works fine. Is there a solution to fix this?

    1

    Please sign in or sign up for free to reply

    1. Commented 2 days ago

      Hi gribbl!!

      So, I looked into this a little bit, and it seems like everything TypeScript related for these components that are auto-imported via unplugin-vue-components begins working if you add the generated components.d.ts file into the /intertia/tsconfig.json include array, like below.

      {
        "extends": "@adonisjs/tsconfig/tsconfig.client.json",
        "compilerOptions": {
          "baseUrl": ".",
          "jsx": "preserve",
          "module": "ESNext",
          "jsxImportSource": "vue",
          "paths": {
            "~/*": ["./*"],
          }
        },
        "include": ["./**/*.ts", "./**/*.vue", "../components.d.ts"]
      }
      Copied!

      Here's the result:

      I'm going to go tack a note about this into lesson 1.4, where we setup unplugin-vue-components!

      1

      Please sign in or sign up for free to reply

      1. Commented 11 hours ago

        Thank you. 👍

        0

        Please sign in or sign up for free to reply