robobyte-front-builder 1.0.12 → 1.0.13
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
|
@@ -3,7 +3,7 @@ import { DataTypes } from './ContentTypes'
|
|
|
3
3
|
import { resolveURL, getAccessToken } from './config'
|
|
4
4
|
import toast from 'react-hot-toast'
|
|
5
5
|
|
|
6
|
-
export default async function UpdateService(endpoint, showToast, data, params) {
|
|
6
|
+
export default async function UpdateService(endpoint, showToast, data, params, urlExtra = '') {
|
|
7
7
|
const accessToken = getAccessToken()
|
|
8
8
|
let response = { status: 'Error', message: '' }
|
|
9
9
|
let result = null
|
|
@@ -18,7 +18,7 @@ export default async function UpdateService(endpoint, showToast, data, params) {
|
|
|
18
18
|
...(endpoint.DataType == DataTypes.Body ? { ...data } : {})
|
|
19
19
|
}
|
|
20
20
|
if (!data) return
|
|
21
|
-
const url = resolveURL(endpoint)
|
|
21
|
+
const url = resolveURL(endpoint) + urlExtra
|
|
22
22
|
|
|
23
23
|
const axiosConfig = {
|
|
24
24
|
method: 'put',
|
|
@@ -38,14 +38,16 @@ export default function ViewTab() {
|
|
|
38
38
|
let response = null;
|
|
39
39
|
|
|
40
40
|
if(viewMetaData.isNew) {
|
|
41
|
-
response = await Services.PostService(Endpoints.UiBuilder.Post.AddUpdate, true, data
|
|
42
|
-
id: viewMetaData.isNew ? 0 : viewMetaData.id
|
|
43
|
-
})
|
|
41
|
+
response = await Services.PostService(Endpoints.UiBuilder.Post.AddUpdate, true, data)
|
|
44
42
|
}
|
|
45
43
|
else {
|
|
46
|
-
response = await Services.UpdateService(
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
response = await Services.UpdateService(
|
|
45
|
+
Endpoints.UiBuilder.Post.AddUpdate,
|
|
46
|
+
true,
|
|
47
|
+
data,
|
|
48
|
+
{},
|
|
49
|
+
`/${viewMetaData.id}`
|
|
50
|
+
)
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
if (response) {
|