@tpzdsp/next-toolkit 1.4.1 → 1.4.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tpzdsp/next-toolkit",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "A reusable React component library for Next.js applications",
5
5
  "type": "module",
6
6
  "private": false,
@@ -84,7 +84,8 @@
84
84
  padding-top: 0.5rem;
85
85
  }
86
86
 
87
- .ol-geocoder .gcd-txt-control {
87
+
88
+ #gcd-container, .ol-geocoder .gcd-txt-control {
88
89
  height: unset !important;
89
90
  }
90
91
 
@@ -19,7 +19,6 @@ export type MapComponentProps = {
19
19
  geocoderUrl: string;
20
20
  basePath: string;
21
21
  isLoading?: boolean;
22
- error?: Error;
23
22
  };
24
23
 
25
24
  const positionTransforms: Record<PopupDirection, string> = {
@@ -48,9 +47,7 @@ export const MapComponent = ({
48
47
  geocoderUrl,
49
48
  basePath,
50
49
  isLoading,
51
- error,
52
50
  }: MapComponentProps) => {
53
- console.log('ERROR: ', error);
54
51
  const [popupFeatures, setPopupFeatures] = useState([]);
55
52
  const [popupCoordinate, setPopupCoordinate] = useState<number[] | null>(null);
56
53
  const [popupPositionClass, setPopupPositionClass] = useState<PopupDirection>('bottom-right');
package/src/types/api.ts CHANGED
@@ -19,7 +19,7 @@ export type PaginatedResponse<T = unknown> = {
19
19
 
20
20
  // Since we only ever fetch a single API we don't need multiple failure types,
21
21
  // so defining a global one as the default is fine. This can be changed per-app.
22
- export type ApiFailure = { message: string; status?: number; code?: string; details?: unknown };
22
+ export type ApiFailure = { message: string; status?: number; code?: string; detail: string };
23
23
 
24
24
  type GenericResponse<Ok, Error> =
25
25
  | ({
package/src/utils/http.ts CHANGED
@@ -128,21 +128,10 @@ const post = <Ok, Error = ApiFailure>(
128
128
  body: unknown,
129
129
  options?: RequestInit,
130
130
  ): Promise<Response<Ok, Error>> => {
131
- let requestBody: string;
132
-
133
- // If body is an empty object, send an empty string
134
- if (body && typeof body === 'object' && !Array.isArray(body) && Object.keys(body).length === 0) {
135
- requestBody = '';
136
- } else if (body === undefined || body === null) {
137
- requestBody = '';
138
- } else {
139
- requestBody = JSON.stringify(body);
140
- }
141
-
142
131
  const requestOptions = {
143
132
  ...options,
144
133
  method: HttpMethod.Post,
145
- body: requestBody,
134
+ body: JSON.stringify(body),
146
135
  headers: {
147
136
  'Content-Type': MimeTypes.Json,
148
137
  ...options?.headers,