27 lines
1.0 KiB
JavaScript
27 lines
1.0 KiB
JavaScript
|
|
import { request } from './client.js'
|
||
|
|
|
||
|
|
export async function getFrameworkProgramSkillProfile(frameworkId) {
|
||
|
|
return request(`/api/training-framework-programs/${frameworkId}/skill-profile`)
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function getTrainingModuleSkillProfile(moduleId) {
|
||
|
|
return request(`/api/training-modules/${moduleId}/skill-profile`)
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function getProgressionGraphSkillProfile(graphId) {
|
||
|
|
return request(`/api/exercise-progression-graphs/${graphId}/skill-profile`)
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @param {number[]} skillIds
|
||
|
|
* @param {{ types?: string, limit?: number }} opts
|
||
|
|
*/
|
||
|
|
export async function getSkillDiscoverySuggestions(skillIds, opts = {}) {
|
||
|
|
const ids = (skillIds || []).filter((x) => x != null && Number(x) > 0).join(',')
|
||
|
|
if (!ids) return { skill_ids: [], suggestions: [] }
|
||
|
|
const params = new URLSearchParams({ skill_ids: ids })
|
||
|
|
if (opts.types) params.set('types', opts.types)
|
||
|
|
if (opts.limit != null) params.set('limit', String(opts.limit))
|
||
|
|
return request(`/api/skill-discovery/suggestions?${params.toString()}`)
|
||
|
|
}
|