datadirect
Version:
Types for working with Blackbaud's front-end APIs
25 lines (24 loc) • 794 B
JavaScript
import * as Endpoint from '../../../../Endpoint.js';
export function assignment() {
return (payload, base) => {
const { id, leadSectionId, row = null, column = null, cell = null } = payload;
if (!id) {
throw new Error('id must be set (usually to topic.TopicID');
}
if (!leadSectionId) {
throw new Error('leadSectionId must be set (usually to section.Id');
}
return Endpoint.prepare({
payload: {
id,
leadSectionId,
row,
column,
cell,
selectedOnly: true // TODO make assignments selectedOnly configurable?
},
base,
path: '/api/topic/topicassignmentsget/'
});
};
}