@symbo.ls/fetch 2.6.16 → 2.6.20
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/index.js +8 -3
- package/package.json +4 -2
package/index.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { client, fetch, set } from '@symbo.ls/based'
|
|
4
4
|
import { deepMerge, isObject } from '@domql/utils'
|
|
5
5
|
import { setCookie } from '@domql/cookie'
|
|
6
|
-
import { router } from '@domql/router'
|
|
7
6
|
|
|
8
7
|
import TMP_DATA from '@symbo.ls/temp-db'
|
|
9
8
|
import CONFIG_DEFAULT from '@symbo.ls/config-default'
|
|
@@ -25,7 +24,7 @@ export const syncSystem = (data, el, s) => {
|
|
|
25
24
|
let temporaryProject = TMP_DATA[s.appKey]
|
|
26
25
|
if (!temporaryProject) temporaryProject = {}
|
|
27
26
|
const { SYSTEM, STATE } = temporaryProject
|
|
28
|
-
|
|
27
|
+
let { system, state } = data
|
|
29
28
|
|
|
30
29
|
const defObjs = {
|
|
31
30
|
system: SYSTEM || CONFIG_DEFAULT,
|
|
@@ -35,17 +34,23 @@ export const syncSystem = (data, el, s) => {
|
|
|
35
34
|
if (isObject(system)) {
|
|
36
35
|
deepMerge(system, defObjs.system)
|
|
37
36
|
} else {
|
|
37
|
+
system = defObjs.system
|
|
38
38
|
// set({ $id: s.projectId, system: defObjs.system })
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
if (isObject(state)) {
|
|
42
42
|
deepMerge(state, defObjs.state)
|
|
43
43
|
} else {
|
|
44
|
+
state = defObjs.state
|
|
44
45
|
// set({ $id: s.projectId, state: defObjs.state })
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
// deepMerge(s.PROJECT_SYSTEM, system)
|
|
48
49
|
// deepMerge(s.PROJECT_STATE, state)
|
|
50
|
+
s.update({
|
|
51
|
+
PROJECT_SYSTEM: system,
|
|
52
|
+
PROJECT_STATE: state
|
|
53
|
+
})
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
export const publishSystem = (data, el, s) => {
|
|
@@ -83,7 +88,7 @@ export const fetchProject = (el, s, { userName, projectId, ...options }) => {
|
|
|
83
88
|
export const fetchUser = (el, s, options) => {
|
|
84
89
|
const { userName, projectId } = s
|
|
85
90
|
if (!userName || !projectId) {
|
|
86
|
-
fetch({
|
|
91
|
+
fetch({
|
|
87
92
|
$id: s.userId,
|
|
88
93
|
name: true,
|
|
89
94
|
projects: {
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/fetch",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.20",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"dependencies": {
|
|
6
|
+
"@domql/cookie": "latest",
|
|
7
|
+
"@domql/utils": "latest",
|
|
6
8
|
"@symbo.ls/based": "latest",
|
|
7
9
|
"@symbo.ls/config-default": "latest",
|
|
8
10
|
"@symbo.ls/temp-db": "latest"
|
|
9
11
|
},
|
|
10
|
-
"gitHead": "
|
|
12
|
+
"gitHead": "678cbec0d860a40862cdf14a530ff24dd112d561"
|
|
11
13
|
}
|