Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EW-1070 creating post endpoints to create a course #5385

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open

Conversation

psachmann
Copy link
Contributor

@psachmann psachmann commented Dec 5, 2024

Description

This PR creates a POST endpoint for courses to create new courses on the API v3 route (NestJS). The course-client module was renamed to courses-client and was moved to the infra folder. The NPM script generate-client:courses-api was created to simplify the generation of the client from an Open API specification.

Links to Tickets or other pull requests

Approval for review

  • DEV: If api was changed - generate-client:server was executed in vue frontend and changes were tested and put in a PR with the same branch name.
  • QA: In addition to review, the code has been manually tested (if manual testing is possible)
  • All points were discussed with the ticket creator, support-team or product owner. The code upholds all quality guidelines from the PR-template.

@psachmann psachmann self-assigned this Dec 5, 2024
Copy link

sonarcloud bot commented Dec 11, 2024

@psachmann psachmann marked this pull request as ready for review December 11, 2024 16:08
import { CourseCommonCartridgeMetadataResponse, CoursesApi, CreateCourseBodyParams } from './generated';

@Injectable()
export class CoursesClientAdapter {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why should we move common-cartridge to infra?

}

private async createCourse(parser: CommonCartridgeFileParser): Promise<void> {
const courseName = parser.getTitle() || 'Untitled Course';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SonarQube: Prefer using nullish coalescing operator (??) instead of a logical or (||), as it is a safer operator

Suggested change
const courseName = parser.getTitle() || 'Untitled Course';
const courseName = parser.getTitle() ?? 'Untitled Course';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants