@omniumretail/shared-resources 0.1.90 → 0.1.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,4 +7,5 @@ export declare const postAuth0: <T>(path: string, params?: Record<string, unknow
7
7
  export declare const toDeleteAuth0: <T>(path: string, params?: Record<string, unknown>, body?: unknown) => Promise<T>;
8
8
  export declare const post: <T>(path: string, body?: unknown) => Promise<T>;
9
9
  export declare const put: <T>(path: string, body?: unknown) => Promise<T>;
10
+ export declare const patch: <T>(path: string, body?: unknown) => Promise<T>;
10
11
  export declare const toDelete: <T>(path: string, body?: unknown) => Promise<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.1.90",
3
+ "version": "0.1.91",
4
4
  "private": false,
5
5
  "description": "Shared Components and services or utils to the frontend versions",
6
6
  "main": "dist/bundle.js",
@@ -33,6 +33,11 @@ export const put = <T>(path: string, body?: unknown): Promise<T> => {
33
33
  return buildApiRequest<T>(path, 'PUT', body);
34
34
  }
35
35
 
36
+ export const patch = <T>(path: string, body?: unknown): Promise<T> => {
37
+ return buildApiRequest<T>(path, 'PATCH', body);
38
+
39
+ }
40
+
36
41
  export const toDelete = <T>(path: string, body?: unknown): Promise<T> => {
37
42
  return buildApiRequest<T>(path, 'DELETE', body);
38
43
  }
@@ -97,7 +102,7 @@ const buildApiRequestForAuth0 = <T>(path: string, method = 'GET', data?: unknown
97
102
 
98
103
  let body: FormData | string | undefined | any;
99
104
 
100
- if (['POST', 'PUT'].includes(method)) {
105
+ if (['POST', 'PUT', 'PATCH'].includes(method)) {
101
106
  if (bodyType === 'formdata') {
102
107
  // Não é necessário dar set do contentType porque o fetch faz isso por nós quando usamos o fetch
103
108
  body = data;