mirror of
https://github.com/LukeHagar/developer.sailpoint.com.git
synced 2025-12-09 12:27:47 +00:00
49 lines
1.0 KiB
JavaScript
49 lines
1.0 KiB
JavaScript
export async function getTopPosts() {
|
|
try {
|
|
const response = await fetch(
|
|
'https://developer.sailpoint.com/discuss/top.json',
|
|
);
|
|
return await response.json();
|
|
} catch (error) {
|
|
return [];
|
|
}
|
|
}
|
|
|
|
export async function getBlogPosts(tags) {
|
|
let url = ''
|
|
if (tags) {
|
|
url = 'https://developer.sailpoint.com/discuss/search.json?q=category:blog+tags:' + tags
|
|
} else {
|
|
url = 'https://developer.sailpoint.com/discuss/search.json?q=category:blog'
|
|
}
|
|
try {
|
|
const response = await fetch(
|
|
url,
|
|
);
|
|
return await response.json();
|
|
} catch (error) {
|
|
return [];
|
|
}
|
|
}
|
|
|
|
export async function getTopic(id) {
|
|
try {
|
|
const response = await fetch(
|
|
'https://developer.sailpoint.com/discuss/t/' + id + '.json',
|
|
);
|
|
return await response.json();
|
|
} catch (error) {
|
|
return [];
|
|
}
|
|
}
|
|
|
|
export async function getTags() {
|
|
try {
|
|
const response = await fetch(
|
|
'https://developer.sailpoint.com/discuss/tags.json',
|
|
);
|
|
return await response.json();
|
|
} catch (error) {
|
|
return [];
|
|
}
|
|
} |