UNPKG

contentful-management

Version:
31 lines (28 loc) 975 B
import copy from 'fast-copy'; import { del as del$1, get as get$1, put } from './raw.mjs'; const getBaseUrl = (params) => `/organizations/${params.organizationId}/organization_memberships`; const getEntityUrl = (params) => `${getBaseUrl(params)}/${params.organizationMembershipId}`; const get = (http, params) => { return get$1(http, getEntityUrl(params)); }; const getMany = (http, params) => { return get$1(http, getBaseUrl(params), { params: params.query, }); }; const update = (http, params, rawData, headers) => { const data = copy(rawData); delete data.sys; const { role } = data; return put(http, getEntityUrl(params), { role }, { headers: { ...headers, 'X-Contentful-Version': rawData.sys.version ?? 0, }, }); }; const del = (http, params) => { return del$1(http, getEntityUrl(params)); }; export { del, get, getMany, update }; //# sourceMappingURL=organization-membership.mjs.map