import { get, post, } from "../../editor/services/serviceHelper";
// ---- Reads ----
export function getProjectGoals(projectId, includeDescendants = false) {
    const params = new URLSearchParams({ projectId });
    if (includeDescendants)
        params.set("includeDescendants", "true");
    return get(`/parhelia/tasks/projectGoals?${params.toString()}`);
}
export function getGoalCatalog(projectId) {
    return get(`/parhelia/tasks/projectGoalCatalog?projectId=${encodeURIComponent(projectId)}`);
}
export function createGoal(input) {
    return post("/parhelia/tasks/createGoal", input);
}
export function updateGoal(input) {
    return post("/parhelia/tasks/updateGoal", input);
}
export function deleteGoal(goalId) {
    return post(`/parhelia/tasks/deleteGoal?goalId=${encodeURIComponent(goalId)}`, {});
}
export function createSubgoal(input) {
    return post("/parhelia/tasks/createSubgoal", input);
}
export function updateSubgoal(input) {
    return post("/parhelia/tasks/updateSubgoal", input);
}
export function deleteSubgoal(subgoalId) {
    return post(`/parhelia/tasks/deleteSubgoal?subgoalId=${encodeURIComponent(subgoalId)}`, {});
}
// ---- Reorder ----
export function reorderGoals(input) {
    return post("/parhelia/tasks/reorderGoals", input);
}
export function reorderSubgoals(input) {
    return post("/parhelia/tasks/reorderSubgoals", input);
}
//# sourceMappingURL=goalService.js.map