Kairo-Jinkendo/frontend/src/api/steering.js

23 lines
684 B
JavaScript
Raw Normal View History

import { apiFetch } from './client.js'
export function listSteeringMethods() {
return apiFetch('/api/steering/methods')
}
export function updateInitiativeSteeringMethod(initiativeId, methodKey) {
return apiFetch(`/api/steering/initiatives/${initiativeId}/context`, {
method: 'PATCH',
body: JSON.stringify({ method_key: methodKey }),
})
}
export function updateInitiativeMethodProfile(initiativeId, methodProfileKey) {
const body = methodProfileKey
? { method_profile_key: methodProfileKey }
: { clear_method_profile: true }
return apiFetch(`/api/steering/initiatives/${initiativeId}/context`, {
method: 'PATCH',
body: JSON.stringify(body),
})
}