fix: create links to forumTopicIds or search
This commit is contained in:
committed by
mrugesh
parent
31f337f2bd
commit
16551d2ad6
@ -167,10 +167,10 @@ class ShowClassic extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getGuideUrl() {
|
getGuideUrl() {
|
||||||
const {
|
const { forumTopicId, title } = this.getChallenge();
|
||||||
fields: { slug }
|
return forumTopicId
|
||||||
} = this.getChallenge();
|
? 'https://www.freecodecamp.org/forum/t/' + forumTopicId
|
||||||
return createGuideUrl(slug);
|
: createGuideUrl(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
getVideoUrl = () => this.getChallenge().videoUrl;
|
getVideoUrl = () => this.getChallenge().videoUrl;
|
||||||
@ -303,6 +303,7 @@ export const query = graphql`
|
|||||||
instructions
|
instructions
|
||||||
challengeType
|
challengeType
|
||||||
videoUrl
|
videoUrl
|
||||||
|
forumTopicId
|
||||||
fields {
|
fields {
|
||||||
slug
|
slug
|
||||||
blockName
|
blockName
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
const guideBase = 'https://www.freecodecamp.org/forum/search?q=';
|
const guideBase = 'https://www.freecodecamp.org/forum/search?q=';
|
||||||
|
|
||||||
export function createGuideUrl(slug = '') {
|
export function createGuideUrl(title = '') {
|
||||||
return (
|
return guideBase + title + '%20in%3Atitle%20order%3Aviews';
|
||||||
guideBase +
|
|
||||||
slug.substring(slug.lastIndexOf('/') + 1) +
|
|
||||||
'%20%40camperbot%20%23guide'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isGoodXHRStatus(status) {
|
export function isGoodXHRStatus(status) {
|
||||||
|
Reference in New Issue
Block a user