Skip to content

refactor: change endpoints and skeleton#2

Draft
Alec4r wants to merge 1 commit intomainfrom
dam/catalog_list
Draft

refactor: change endpoints and skeleton#2
Alec4r wants to merge 1 commit intomainfrom
dam/catalog_list

Conversation

@Alec4r
Copy link
Member

@Alec4r Alec4r commented Nov 18, 2025

No description provided.

Comment on lines -7 to +14
const response = await client.get(`${getConfig().LMS_BASE_URL}/api/learning_paths/v1/learning-paths/`);
const response = await client.get(`${getConfig().LMS_BASE_URL}/partner_catalog/api/v1/partners/1/catalogs/`);
const data = response.data.results || response.data;
return camelCaseObject(data);
}

export async function fetchLearningPathDetail(key) {
const client = getAuthenticatedHttpClient();
const response = await client.get(`${getConfig().LMS_BASE_URL}/api/learning_paths/v1/learning-paths/${key}/`);
const response = await client.get(`${getConfig().LMS_BASE_URL}/partner_catalog/api/v1/partners/1/catalogs/${key}/`);
Copy link
Member Author

Choose a reason for hiding this comment

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

@dcoa @Ang-m4 these are the main endpoints that we need to change.

statusVariant = 'pending';
buttonText = 'Accept the invitation';
buttonIcon = Check
statusAltText = "Pending Invitation"
Copy link
Member Author

Choose a reason for hiding this comment

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

@dcoa I'm not sure how the i18n works here, I mean I know that NAU has a "language selector" so how can we make this works?

Copy link

Choose a reason for hiding this comment

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

we need to use frontend-platform i18n (which under the hood uses react-intl: https://formatjs.github.io/docs/react-intl/)

This mean:

// import the hook
import { useIntl } from '@edx/frontend-platform/i18n';

// import the default messages 
import messages
...
const LearningPathCard = ({ learningPath, showFilters = false }) => {

// init the hook
const intl = useIntl();

...

// add the default messages 
buttonText = intl.formatMessage(messages['learning.path.card.button.sent.label'])

The message files looks like this one https://github.com/openedx/frontend-app-admin-console/blob/master/src/authz-module/libraries-manager/messages.ts

} flex-column justify-content-center align-items-end`}
>
{isManager && (
<Link to={`/learningpath/${key}`}>
Copy link
Member Author

Choose a reason for hiding this comment

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

@dcoa we should change this for the "corporate dashboard" link

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