Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src-ts/tools/learn/learn-config/learn-config.model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export interface LearnConfigModel {
API: string
CERT_ALT_PARAMS: { [key: string]: string }
CERT_DOMAIN: string
CERT_ELEMENT_SELECTOR: {
attribute: string,
Expand Down
3 changes: 3 additions & 0 deletions src-ts/tools/learn/learn-config/learn.default.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { LearnConfigModel } from './learn-config.model'

export const LearnConfigDefault: LearnConfigModel = {
API: 'http://localhost:3001/v5/learning-paths',
CERT_ALT_PARAMS: {
'view-port': 'large-container',
},
CERT_DOMAIN: 'https://certificate.topcoder-dev.com',
CERT_ELEMENT_SELECTOR: {
attribute: 'data-id',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { logInfo } from '../../../../../lib'
import { LearnConfig } from '../../../learn-config'
import { getUserCertificateUrl } from '../../../learn.routes'
import { learnUrlGet, learnXhrGetAsync, learnXhrPostAsync, learnXhrPutAsync } from '../../functions'
Expand All @@ -16,15 +15,15 @@ export function completeCourse(
): Promise<LearnUserCertificationProgress> {

// construct the certificate params
const certificateAlternateParams: { [key: string]: string } = LearnConfig.CERT_ALT_PARAMS
const certificateElement: string = `[${LearnConfig.CERT_ELEMENT_SELECTOR.attribute}=${LearnConfig.CERT_ELEMENT_SELECTOR.value}]`
const certificateUrl: string = getUserCertificateUrl(provider, certification, handle)

logInfo(`Completing course w certificate URL = ${certificateUrl}`)

return updateAsync(
certificationProgressId,
UserCertificationUpdateProgressActions.completeCertificate,
{
certificateAlternateParams,
certificateElement,
certificateUrl,
}
Expand Down