1 | import { op, get, post, patch, del } from "@pnp/queryable";
|
2 | export const spGet = (o, init) => {
|
3 | return op(o, get, init);
|
4 | };
|
5 | export const spPost = (o, init) => op(o, post, init);
|
6 | export const spPostMerge = (o, init) => {
|
7 | init = init || {};
|
8 | init.headers = { ...init.headers, "X-HTTP-Method": "MERGE" };
|
9 | return spPost(o, init);
|
10 | };
|
11 | export const spPostDelete = (o, init) => {
|
12 | init = init || {};
|
13 | init.headers = { ...init.headers || {}, "X-HTTP-Method": "DELETE" };
|
14 | return spPost(o, init);
|
15 | };
|
16 | export const spPostDeleteETag = (o, init, eTag = "*") => {
|
17 | init = init || {};
|
18 | init.headers = { ...init.headers || {}, "IF-Match": eTag };
|
19 | return spPostDelete(o, init);
|
20 | };
|
21 | export const spDelete = (o, init) => op(o, del, init);
|
22 | export const spPatch = (o, init) => op(o, patch, init);
|
23 |
|
\ | No newline at end of file |