tsv2-library 1.0.60 → 1.0.61-alpha.1

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,7 +1,7 @@
1
1
  {
2
2
  "name": "tsv2-library",
3
3
  "author": "fixedassetv2-fe",
4
- "version": "1.0.60",
4
+ "version": "1.0.61-alpha.1",
5
5
  "license": "ISC",
6
6
  "homepage": "https://github.com/fixedassetv2-fe/tsv2-library#readme",
7
7
  "repository": {
@@ -125,6 +125,12 @@ export interface ButtonScanProps extends TSButtonProps {
125
125
  * @default false
126
126
  */
127
127
  labelOnly?: boolean;
128
+ /**
129
+ * Base z-index for dialog of scan
130
+ *
131
+ * @default 0
132
+ */
133
+ baseZIndex?: number;
128
134
  size: 'small' | 'large';
129
135
  }
130
136
 
@@ -71,6 +71,10 @@ export interface DialogConfirmProps {
71
71
  * @default true;
72
72
  */
73
73
  closable?: boolean;
74
+ /**
75
+ * @default 0
76
+ */
77
+ baseZIndex?: number;
74
78
  }
75
79
 
76
80
  /**
@@ -0,0 +1,37 @@
1
+ import axios, { AxiosInstance, AxiosResponse } from 'axios';
2
+
3
+ export interface ServiceOptions {
4
+ headers?: Record<string, unknown>;
5
+ params?: Record<string, unknown>;
6
+ }
7
+
8
+ export const API = ({
9
+ headers = {},
10
+ params = {},
11
+ }: ServiceOptions = {}): AxiosInstance => {
12
+ const user = JSON.parse(localStorage.getItem('user') ?? '{}');
13
+ const BASE_URL = import.meta.env.VITE_APP_TAGSAMURAI_API;
14
+
15
+ const instance = axios.create({
16
+ baseURL: `${BASE_URL}/tag/v2/scan-log`,
17
+ headers: {
18
+ 'Content-type': 'application/json',
19
+ 'Authorization': `Bearer ${user.token}`,
20
+ ...headers,
21
+ },
22
+ params,
23
+ });
24
+
25
+ return instance;
26
+ };
27
+
28
+ const postScanLog = (body: {
29
+ tag: string;
30
+ serialNumber: string;
31
+ }): Promise<AxiosResponse> => {
32
+ return API().post('/', body);
33
+ };
34
+
35
+ export default {
36
+ postScanLog,
37
+ };