@gudhub/core 1.1.15 → 1.1.16
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/GUDHUB/AppProcessor/AppProcessor.js +24 -1
- package/GUDHUB/FieldProcessor/FieldProcessor.js +7 -11
- package/GUDHUB/FieldProcessor/FieldProcessor.test.js +30 -1
- package/GUDHUB/ItemProcessor/ItemProcessor.js +16 -5
- package/GUDHUB/ItemProcessor/ItemProcessor.test.js +76 -0
- package/GUDHUB/Storage/ModulesList.js +3 -2
- package/GUDHUB/Utils/json_constructor/json_constructor.test.js +1 -0
- package/GUDHUB/config.js +4 -2
- package/GUDHUB/gudhub.js +3 -3
- package/fake_server/fake_java_server.js +63 -20
- package/package.json +1 -1
- package/umd/library.min.js +6 -6
- package/umd/library.min.js.map +1 -1
|
@@ -105,6 +105,16 @@ export class AppProcessor {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
saveAppInStorage(app) {
|
|
108
|
+
|
|
109
|
+
app.items_object = {};
|
|
110
|
+
|
|
111
|
+
for(let item = 0; item < app.items_list.length; item++) {
|
|
112
|
+
app.items_object[app.items_list[item].item_id] = {};
|
|
113
|
+
for(let field = 0; field < app.items_list[item].fields.length; field++) {
|
|
114
|
+
app.items_object[app.items_list[item].item_id][app.items_list[item].fields[field].field_id] = app.items_list[item].fields[field];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
108
118
|
const storageApp = this.storage.getApp(app.app_id);
|
|
109
119
|
if (storageApp) {
|
|
110
120
|
app.from_apps_list = storageApp.from_apps_list;
|
|
@@ -122,6 +132,7 @@ export class AppProcessor {
|
|
|
122
132
|
app.items_list = storageApp.items_list;
|
|
123
133
|
app.file_list = storageApp.file_list;
|
|
124
134
|
app.from_apps_list = storageApp.from_apps_list;
|
|
135
|
+
app.items_object =storageApp.items_object;
|
|
125
136
|
this.storage.updateApp(app);
|
|
126
137
|
//-- Sending updates for Views Updates
|
|
127
138
|
this.pipeService.emit(
|
|
@@ -167,6 +178,15 @@ export class AppProcessor {
|
|
|
167
178
|
try {
|
|
168
179
|
const app = await this.getAppApi(app_id);
|
|
169
180
|
if (app) {
|
|
181
|
+
app.items_object = {};
|
|
182
|
+
|
|
183
|
+
for(let item = 0; item < app.items_list.length; item++) {
|
|
184
|
+
app.items_object[app.items_list[item].item_id] = {};
|
|
185
|
+
for(let field = 0; field < app.items_list[item].fields.length; field++) {
|
|
186
|
+
app.items_object[app.items_list[item].item_id][app.items_list[item].fields[field].field_id] = app.items_list[item].fields[field];
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
170
190
|
this.storage.updateApp(app);
|
|
171
191
|
}
|
|
172
192
|
} catch (err) {
|
|
@@ -254,7 +274,9 @@ export class AppProcessor {
|
|
|
254
274
|
}
|
|
255
275
|
}
|
|
256
276
|
|
|
257
|
-
|
|
277
|
+
// This code for trash must be changed
|
|
278
|
+
// return trash ? app : {...app, items_list: app.items_list.filter(item => !item.trash)};
|
|
279
|
+
return app;
|
|
258
280
|
}
|
|
259
281
|
|
|
260
282
|
async updateApp(app) {
|
|
@@ -282,6 +304,7 @@ export class AppProcessor {
|
|
|
282
304
|
|
|
283
305
|
async createNewApp(app) {
|
|
284
306
|
const newApp = await this.createNewAppApi(app);
|
|
307
|
+
newApp.items_object = {};
|
|
285
308
|
this.addNewAppToStorage(newApp);
|
|
286
309
|
return newApp;
|
|
287
310
|
}
|
|
@@ -77,11 +77,13 @@ export class FieldProcessor {
|
|
|
77
77
|
item.fields.forEach((field) => {
|
|
78
78
|
if (field.field_id == field_id) {
|
|
79
79
|
field.field_value = field_value;
|
|
80
|
+
app.items_object[item.item_id][field.field_id] = field;
|
|
80
81
|
}
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
84
|
});
|
|
84
85
|
this.storage.updateApp(app);
|
|
86
|
+
return field_value;
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
async getField(app_id, field_id) {
|
|
@@ -116,16 +118,10 @@ export class FieldProcessor {
|
|
|
116
118
|
let fieldValue = null;
|
|
117
119
|
const app = await this.appProcessor.getApp(app_id);
|
|
118
120
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
(field) => field.field_id == field_id
|
|
124
|
-
);
|
|
125
|
-
if (fundedField) {
|
|
126
|
-
fieldValue = fundedField.field_value;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
121
|
+
try {
|
|
122
|
+
fieldValue = app.items_object[item_id][field_id].field_value;
|
|
123
|
+
} catch(err) {
|
|
124
|
+
|
|
129
125
|
}
|
|
130
126
|
|
|
131
127
|
return fieldValue;
|
|
@@ -136,7 +132,7 @@ export class FieldProcessor {
|
|
|
136
132
|
return;
|
|
137
133
|
}
|
|
138
134
|
await this.setFieldValueApi(app_id, item_id, field_id, field_value);
|
|
139
|
-
this.updateFieldValue(app_id, item_id, field_id, field_value);
|
|
135
|
+
return this.updateFieldValue(app_id, item_id, field_id, field_value);
|
|
140
136
|
}
|
|
141
137
|
|
|
142
138
|
fieldListeners() {
|
|
@@ -10,7 +10,36 @@ describe("FIELD PROCESSOR", async function() {
|
|
|
10
10
|
var fieldModel = await gudhub.getField(16259, 254055);
|
|
11
11
|
fieldModel.data_type.should.equal('text');
|
|
12
12
|
(typeof fieldModel).should.equal('object');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('GET FIELD VALUE / should return a field value', async () => {
|
|
16
|
+
let value = await gudhub.getFieldValue(16259, 1064673, 254055);
|
|
17
|
+
value.should.equal('Hall up');
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('UPDATE FIELD AND GET NEW VALUE / should return new field value', async () => {
|
|
21
|
+
await gudhub.setFieldValue(16259, 1064673, 254055, 'Updated value');
|
|
22
|
+
let value = await gudhub.getFieldValue(16259, 1064673, 254055);
|
|
23
|
+
value.should.equal('Updated value');
|
|
13
24
|
})
|
|
14
25
|
|
|
26
|
+
it('CREATE ITEM AND SET IT VALUE / should return new value of new item', async () => {
|
|
27
|
+
let items = await gudhub.addNewItems(16259, newItems);
|
|
28
|
+
let item_id = items[0].item_id;
|
|
29
|
+
|
|
30
|
+
await gudhub.setFieldValue(16259, item_id, 254056, 'Big Fish Tank');
|
|
31
|
+
|
|
32
|
+
let value = await gudhub.getFieldValue(16259, item_id, 254056);
|
|
33
|
+
|
|
34
|
+
value.should.equal('Big Fish Tank');
|
|
35
|
+
});
|
|
36
|
+
|
|
15
37
|
|
|
16
|
-
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const newItems = [
|
|
41
|
+
{
|
|
42
|
+
item_id: 0,
|
|
43
|
+
fields: []
|
|
44
|
+
},
|
|
45
|
+
]
|
|
@@ -51,10 +51,15 @@ export class ItemProcessor {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
addItemsToStorage(app_id, items) {
|
|
54
|
+
// !!!!! Need to fix this
|
|
54
55
|
const app = this.storage.getApp(app_id);
|
|
55
56
|
if (app) {
|
|
56
57
|
items.forEach((item) => {
|
|
57
58
|
app.items_list.push(item);
|
|
59
|
+
app.items_object[item.item_id] = {};
|
|
60
|
+
for(let field = 0; field < item.fields.length; field++) {
|
|
61
|
+
app.items_object[item.item_id][item.fields[field].field_id] = item.fields[field];
|
|
62
|
+
}
|
|
58
63
|
this.pipeService.emit("gh_item_update", { app_id }, [item]);
|
|
59
64
|
});
|
|
60
65
|
this.pipeService.emit("gh_items_update", { app_id }, app.items_list);
|
|
@@ -88,6 +93,8 @@ export class ItemProcessor {
|
|
|
88
93
|
//-- Checking if value of existing fields were updated, because we are not sending updates if value didn't changed
|
|
89
94
|
if (fundedField.field_value != field.field_value) {
|
|
90
95
|
fundedField.field_value = field.field_value;
|
|
96
|
+
app.items_object[fundedItem.item_id][fundedField.field_id] = fundedField;
|
|
97
|
+
|
|
91
98
|
this.pipeService.emit(
|
|
92
99
|
"gh_value_update",
|
|
93
100
|
addressToEmit,
|
|
@@ -113,9 +120,13 @@ export class ItemProcessor {
|
|
|
113
120
|
deleteItemsFromStorage(app_id, itemsForDelete = []) {
|
|
114
121
|
const app = this.storage.getApp(app_id);
|
|
115
122
|
if (app) {
|
|
116
|
-
app.items_list = app.items_list.filter(
|
|
117
|
-
(
|
|
118
|
-
|
|
123
|
+
app.items_list = app.items_list.filter(item => {
|
|
124
|
+
if(itemsForDelete.find(findedItem => item.item_id == findedItem.item_id)) {
|
|
125
|
+
delete app.items_object[item.item_id];
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
return true;
|
|
129
|
+
});
|
|
119
130
|
this.pipeService.emit("gh_items_update", { app_id }, app.items_list);
|
|
120
131
|
this.storage.updateApp(app);
|
|
121
132
|
}
|
|
@@ -148,8 +159,8 @@ export class ItemProcessor {
|
|
|
148
159
|
}
|
|
149
160
|
|
|
150
161
|
async deleteItems(app_id, itemsIds) {
|
|
151
|
-
return this.deleteItemsApi(itemsIds).then(() =>
|
|
152
|
-
this.deleteItemsFromStorage(app_id,
|
|
162
|
+
return this.deleteItemsApi(itemsIds).then((items) =>
|
|
163
|
+
this.deleteItemsFromStorage(app_id, items)
|
|
153
164
|
);
|
|
154
165
|
}
|
|
155
166
|
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import should from "should";
|
|
2
|
+
import { GudHub } from './../gudhub.js';
|
|
3
|
+
|
|
4
|
+
describe("ITEM PROCESSOR", async function () {
|
|
5
|
+
const auth_key = 'Z/lxMHLenEaQTvPjW5U6c3jBDwWFYZrh2F9Kxa3fbt8drvabS2u2lXQ2zI+SRmic';
|
|
6
|
+
const gudhub = new GudHub(auth_key);
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
it("GET ITEM / should return an item", async () => {
|
|
10
|
+
let item = await gudhub.getItem(16259, 1064673);
|
|
11
|
+
item.item_id.should.equal(1064673)
|
|
12
|
+
let itemType = typeof item;
|
|
13
|
+
itemType.should.equal('object');
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("ADD ITEM AND GET IT / should return new item twice", async () => {
|
|
17
|
+
let items = await gudhub.addNewItems(16259, newItems);
|
|
18
|
+
|
|
19
|
+
let isItemsArray = Array.isArray(items);
|
|
20
|
+
|
|
21
|
+
isItemsArray.should.equal(true);
|
|
22
|
+
items[0].fields[0].field_value.should.equal('Big Fish Tank');
|
|
23
|
+
|
|
24
|
+
let item = await gudhub.getItem(16259, items[0].item_id);
|
|
25
|
+
|
|
26
|
+
item.fields[0].field_value.should.equal('Big Fish Tank');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("ADD NEW ITEM AND GET ITS VALUE / should return new item's value", async () => {
|
|
30
|
+
let items = await gudhub.addNewItems(16259, newItems);
|
|
31
|
+
let item_id = items[0].item_id;
|
|
32
|
+
|
|
33
|
+
let value = await gudhub.getFieldValue(16259, item_id, 254056);
|
|
34
|
+
|
|
35
|
+
value.should.equal('Big Fish Tank');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("ADD NEW ITEM, UPDATE ITS VALUE AND GET IT / should return updated value of new item", async () => {
|
|
39
|
+
let items = await gudhub.addNewItems(16259, newItems);
|
|
40
|
+
let item_id = items[0].item_id;
|
|
41
|
+
|
|
42
|
+
await gudhub.setFieldValue(16259, item_id, 254056, 'Updated value');
|
|
43
|
+
|
|
44
|
+
let value = await gudhub.getFieldValue(16259, item_id, 254056);
|
|
45
|
+
|
|
46
|
+
value.should.equal('Updated value');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("ADD NEW ITEM, THEN DELETE IT / should return null", async () => {
|
|
50
|
+
let items = await gudhub.addNewItems(16259, newItems);
|
|
51
|
+
let item_id = items[0].item_id;
|
|
52
|
+
|
|
53
|
+
await gudhub.deleteItems(16259, [item_id]);
|
|
54
|
+
|
|
55
|
+
let value = await gudhub.getFieldValue(16259, item_id, 254056);
|
|
56
|
+
|
|
57
|
+
let isValueNull = value === null ? true : false;
|
|
58
|
+
|
|
59
|
+
isValueNull.should.equal(true);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const newItems = [
|
|
65
|
+
{
|
|
66
|
+
item_id: 0,
|
|
67
|
+
fields: [
|
|
68
|
+
{
|
|
69
|
+
field_id: 254056,
|
|
70
|
+
element_id: 254056,
|
|
71
|
+
field_value: "Big Fish Tank",
|
|
72
|
+
data_id: 5994845
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
]
|
|
@@ -87,8 +87,9 @@ export default function generateModulesList(async_modules_path, file_server_url)
|
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
name: "calendar",
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
js: 'https://gudhub.com/modules/FullCalendar-Gh-Element/dist/main.js',
|
|
91
|
+
css: 'https://gudhub.com/modules/FullCalendar-Gh-Element/dist/style.css',
|
|
92
|
+
type: "class"
|
|
92
93
|
},
|
|
93
94
|
{
|
|
94
95
|
name: "data_ref",
|
|
@@ -19,6 +19,7 @@ describe("JSON CONSTRUCTOR", function () {
|
|
|
19
19
|
gudhub.ghconstructor.initJsdomWindow(window);
|
|
20
20
|
|
|
21
21
|
it("JSON FROM ONE APP : Here we construct simple json from one App", async function () {
|
|
22
|
+
this.timeout(4000);
|
|
22
23
|
//-- checking if json was generated properly
|
|
23
24
|
let json = await gudhub.jsonConstructor(fishtank_scheme);
|
|
24
25
|
json.fishtank[0].should.have.property("name", "Big Fish Tank");
|
package/GUDHUB/config.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
export const server_url = "https://gudhub.com/GudHub";
|
|
2
2
|
//export const server_url = "https://gudhub.com/GudHub_Temp";
|
|
3
3
|
//export const server_url = "https://integration.gudhub.com/GudHub_Test";
|
|
4
|
-
export const server_url = "http://localhost:9000";
|
|
4
|
+
//export const server_url = "http://localhost:9000";
|
|
5
5
|
export const wss_url = "wss://gudhub.com/GudHub/ws/app/";
|
|
6
|
+
export const async_modules_path = 'build/async_modules_node/';
|
|
7
|
+
export const file_server_url = 'http://localhost:8080';
|
|
6
8
|
|
|
7
9
|
// FOR TESTS
|
|
8
10
|
export const port = 9000;
|
package/GUDHUB/gudhub.js
CHANGED
|
@@ -2,7 +2,7 @@ import { GudHubHttpsService } from "./gudhub-https-service.js";
|
|
|
2
2
|
import { PipeService } from "./PipeService/PipeService.js";
|
|
3
3
|
import { Storage } from "./Storage/Storage.js";
|
|
4
4
|
import { WebSocketApi } from "./WebSocket/WebSocket.js";
|
|
5
|
-
import { wss_url, server_url } from "./config.js";
|
|
5
|
+
import { wss_url, server_url, async_modules_path, file_server_url } from "./config.js";
|
|
6
6
|
import { Utils } from "./Utils/Utils.js";
|
|
7
7
|
import { Auth } from "./Auth/Auth.js";
|
|
8
8
|
import { GHConstructor } from "./GHConstructor/ghconstructor.js";
|
|
@@ -25,8 +25,8 @@ export class GudHub {
|
|
|
25
25
|
initWebsocket: false,
|
|
26
26
|
activateSW: false,
|
|
27
27
|
swLink: "",
|
|
28
|
-
async_modules_path
|
|
29
|
-
file_server_url
|
|
28
|
+
async_modules_path,
|
|
29
|
+
file_server_url
|
|
30
30
|
}
|
|
31
31
|
) {
|
|
32
32
|
this.ghconstructor = new GHConstructor(this);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {data} from './fake_server_data/fake_server_data.js';
|
|
1
|
+
import { data } from './fake_server_data/fake_server_data.js';
|
|
2
2
|
import { Utils } from "./../GUDHUB/Utils/Utils.js";
|
|
3
3
|
|
|
4
|
-
export default function(app) {
|
|
4
|
+
export default function (app) {
|
|
5
5
|
app.get('/api/app/get', (req, res) => {
|
|
6
6
|
let app_id = req.query.app_id;
|
|
7
7
|
res.status(200).send(data[app_id]);
|
|
@@ -19,7 +19,7 @@ export default function(app) {
|
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
app.get('/api/applist/get', (req, res) => {
|
|
22
|
-
let responce = {apps_list
|
|
22
|
+
let responce = { apps_list: [data['214'], data['16259']] };
|
|
23
23
|
res.status(200).send(responce);
|
|
24
24
|
});
|
|
25
25
|
|
|
@@ -58,29 +58,72 @@ export default function(app) {
|
|
|
58
58
|
let app_id = req.body.app_id;
|
|
59
59
|
let app = JSON.parse(JSON.stringify(data[app_id]));
|
|
60
60
|
|
|
61
|
-
reqItems.forEach(reqItem =>{
|
|
62
|
-
app.items_list.forEach(item =>{
|
|
63
|
-
if (reqItem.item_id == item.item_id){
|
|
64
|
-
targetItems.push(
|
|
61
|
+
reqItems.forEach(reqItem => {
|
|
62
|
+
app.items_list.forEach(item => {
|
|
63
|
+
if (reqItem.item_id == item.item_id) {
|
|
64
|
+
targetItems.push(item);
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
});
|
|
68
|
-
|
|
69
|
-
result =
|
|
68
|
+
const utils = new Utils();
|
|
69
|
+
result = utils.mergeItems(reqItems, targetItems);
|
|
70
70
|
res.status(200).send(result);
|
|
71
71
|
});
|
|
72
72
|
|
|
73
|
+
app.post('/api/items/add', (req, res) => {
|
|
74
|
+
let newItems = JSON.parse(req.body.items);
|
|
75
|
+
let app_id = req.body.app_id;
|
|
76
|
+
let app = data[app_id];
|
|
77
|
+
|
|
78
|
+
let createdItems = [];
|
|
79
|
+
|
|
80
|
+
newItems.forEach(reqItem => {
|
|
81
|
+
reqItem.last_update = new Date().getTime();
|
|
82
|
+
reqItem.item_id = new Date().getTime() + Math.round(Math.random() * 10000);
|
|
83
|
+
app.items_list.push(reqItem);
|
|
84
|
+
createdItems.push(reqItem);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
res.status(200).send(createdItems);
|
|
88
|
+
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
app.post('/api/items/delete', (req, res) => {
|
|
92
|
+
let itemsIdsToDelete = JSON.parse(req.body.items_ids);
|
|
93
|
+
|
|
94
|
+
let apps = [];
|
|
95
|
+
let appsIds = Object.keys(data);
|
|
96
|
+
for (let i = 0; i < 4; i++) {
|
|
97
|
+
apps.push(data[appsIds[i]]);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
let deletedItems = [];
|
|
101
|
+
|
|
102
|
+
for (let app of apps) {
|
|
103
|
+
|
|
104
|
+
app.items_list = app.items_list.filter(item => {
|
|
105
|
+
if (itemsIdsToDelete.includes(item.item_id)) {
|
|
106
|
+
deletedItems.push(item);
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
return true;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
res.status(200).send(deletedItems);
|
|
114
|
+
|
|
115
|
+
})
|
|
73
116
|
|
|
74
117
|
app.post('/api/new/element/get', (req, res) => {
|
|
75
|
-
let element_id = Number(
|
|
76
|
-
let response = data['16259'].field_list.filter(field =>{
|
|
118
|
+
let element_id = Number(req.body.element_id);
|
|
119
|
+
let response = data['16259'].field_list.filter(field => {
|
|
77
120
|
return field.element_id == element_id;
|
|
78
121
|
});
|
|
79
122
|
res.status(200).send(response[0]);
|
|
80
123
|
});
|
|
81
124
|
|
|
82
125
|
app.post('/file/formupload', (req, res) => {
|
|
83
|
-
res.status(200).send({status
|
|
126
|
+
res.status(200).send({ status: 'created' });
|
|
84
127
|
});
|
|
85
128
|
|
|
86
129
|
app.post('/file/upload', (req, res) => {
|
|
@@ -88,33 +131,33 @@ export default function(app) {
|
|
|
88
131
|
});
|
|
89
132
|
|
|
90
133
|
app.post('/file/update', (req, res) => {
|
|
91
|
-
res.status(200).send({status
|
|
134
|
+
res.status(200).send({ status: 'updated' });
|
|
92
135
|
});
|
|
93
136
|
|
|
94
137
|
app.get('/file/delete', (req, res) => {
|
|
95
138
|
const { file_id } = req.query;
|
|
96
139
|
console.log(req.query);
|
|
97
|
-
res.status(200).send({status
|
|
140
|
+
res.status(200).send({ status: 'deleted', file_id });
|
|
98
141
|
});
|
|
99
|
-
|
|
142
|
+
|
|
100
143
|
app.post('/api/new/document/insert-one', (req, res) => {
|
|
101
144
|
const document = req.body.document;
|
|
102
|
-
res.status(200).send({status: "created"});
|
|
145
|
+
res.status(200).send({ status: "created" });
|
|
103
146
|
})
|
|
104
|
-
|
|
147
|
+
|
|
105
148
|
app.post('/api/new/document/find-one', (req, res) => {
|
|
106
149
|
const document = req.body.document;
|
|
107
|
-
res.status(200).send({status: "founded"});
|
|
150
|
+
res.status(200).send({ status: "founded" });
|
|
108
151
|
})
|
|
109
152
|
|
|
110
153
|
app.post('/api/new/document/find', (req, res) => {
|
|
111
154
|
const document = req.body.document;
|
|
112
|
-
res.status(200).send({status: "founded"});
|
|
155
|
+
res.status(200).send({ status: "founded" });
|
|
113
156
|
})
|
|
114
157
|
|
|
115
158
|
app.post('/api/new/document/remove-one', (req, res) => {
|
|
116
159
|
const document = req.body.document;
|
|
117
|
-
res.status(200).send({status: "deleted"});
|
|
160
|
+
res.status(200).send({ status: "deleted" });
|
|
118
161
|
})
|
|
119
162
|
|
|
120
163
|
}
|