default: {
    checkIfUserCourseExists(
        userId: number,
        courseId: number,
    ): Promise<RowDataPacket[]>;
    deleteUserCourse(
        userId: number,
        courseId: number,
    ): Promise<[QueryResult, FieldPacket[]]>;
    deleteUserCourseByUsercourseid(
        usercourseid: number,
    ): Promise<[QueryResult, FieldPacket[]]>;
    getStudentInfoByUsercourseid(
        usercourseid: number,
    ): Promise<StudentAndTopics[]>;
    getUserCourseByUsercourseid(usercourseid: number): Promise<QueryResult>;
    getUserCourseId(
        studentnumber: string,
        courseid: number,
    ): Promise<QueryResult>;
    insertUserCourse(
        userId: number,
        courseId: number,
    ): Promise<[QueryResult, FieldPacket[]]>;
} = ...

Model for managing user courses.

Type declaration

  • checkIfUserCourseExists:function
    • Checks if a user course exists.

      Parameters

      • userId: number

        The ID of the user.

      • courseId: number

        The ID of the course.

      Returns Promise<RowDataPacket[]>

      A promise that resolves to the existing user course, if any.

  • deleteUserCourse:function
    • Deletes a user course.

      Parameters

      • userId: number

        The ID of the user.

      • courseId: number

        The ID of the course.

      Returns Promise<[QueryResult, FieldPacket[]]>

      A promise that resolves when the deletion is complete.

  • deleteUserCourseByUsercourseid:function
    • Deletes a user course by its ID.

      Parameters

      • usercourseid: number

        The ID of the user course.

      Returns Promise<[QueryResult, FieldPacket[]]>

      A promise that resolves when the deletion is complete.

  • getStudentInfoByUsercourseid:function
    • Gets student information by user course ID.

      Parameters

      • usercourseid: number

        The ID of the user course.

      Returns Promise<StudentAndTopics[]>

      A promise that resolves to the student information.

  • getUserCourseByUsercourseid:function
    • Gets a user course by its ID.

      Parameters

      • usercourseid: number

        The ID of the user course.

      Returns Promise<QueryResult>

      A promise that resolves to the user course.

  • getUserCourseId:function
    • Gets the ID of a user course.

      Parameters

      • studentnumber: string

        The student number.

      • courseid: number

        The ID of the course.

      Returns Promise<QueryResult>

      A promise that resolves to the ID of the user course.

  • insertUserCourse:function
    • Inserts a user course.

      Parameters

      • userId: number

        The ID of the user.

      • courseId: number

        The ID of the course.

      Returns Promise<[QueryResult, FieldPacket[]]>

      A promise that resolves when the insertion is complete.