project-booster-vue 8.119.1 → 8.119.2

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": "project-booster-vue",
3
- "version": "8.119.1",
3
+ "version": "8.119.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "test:unit": "vue-cli-service test:unit --forceExit --detectOpenHandles",
@@ -21,7 +21,7 @@ const getProjectConfigurationsForProjectType = async (inhabitantProjectId, all)
21
21
  const getAllProjectConfigurations = async (inhabitantProjectId, forceNoPriceUpdate) => {
22
22
  let response;
23
23
  if (forceNoPriceUpdate) {
24
- response = await request.get(`/api/inhabitant-projects/${inhabitantProjectId}/simulations`, {
24
+ response = await axios.get(`/api/inhabitant-projects/${inhabitantProjectId}/simulations`, {
25
25
  params: { forceNoPriceUpdate },
26
26
  });
27
27
  } else {
@@ -3,11 +3,12 @@ import he from 'he';
3
3
 
4
4
  const uploadDocument = async (formData, inhabitantProjectId, correlationId, subType, trackProgress, fileName) => {
5
5
  const [name, file] = formData.entries().next().value;
6
- return await request
7
- .post(`/api/inhabitant-projects/${inhabitantProjectId}/documents`)
8
- .attach('document', file)
9
- .field('metadata', JSON.stringify({ type: 'PLAN', correlationId, subType, title: fileName }, null, '\t'))
10
- .on('progress', trackProgress);
6
+ const data = new FormData();
7
+ data.append('document', file);
8
+ data.append('metadata', JSON.stringify({ type: 'PLAN', correlationId, subType, title: fileName }, null, '\t'));
9
+ return await axios.post(`/api/inhabitant-projects/${inhabitantProjectId}/documents`, data, {
10
+ onUploadProgress: trackProgress,
11
+ });
11
12
  };
12
13
 
13
14
  const getDocumentsByInhabitantProjectId = async (start, end, inhabitantProjectId) => {
@@ -35,9 +36,9 @@ const getDocumentThumbnail = async (inhabitantProjectId, documentId) => {
35
36
  };
36
37
 
37
38
  const updateDocumentName = async (inhabitantProjectId, documentId, documentName) => {
38
- return await request
39
- .patch(`/api/inhabitant-projects/${inhabitantProjectId}/documents/${documentId}`)
40
- .send({ title: documentName });
39
+ return await axios.patch(`/api/inhabitant-projects/${inhabitantProjectId}/documents/${documentId}`, {
40
+ title: documentName,
41
+ });
41
42
  };
42
43
 
43
44
  const deleteDocument = async (inhabitantProjectId, documentId) => {
@@ -48,10 +48,9 @@ export const saveEstimate = async (estimate) => {
48
48
  };
49
49
 
50
50
  export const estimate = async (estimatorId, statelessEstimate) => {
51
- const response = await request
52
- .post(`/api/estimators/${estimatorId}:estimate`)
53
- .set('Content-Type', 'application/json')
54
- .send(statelessEstimate);
51
+ const response = await axios.post(`/api/estimators/${estimatorId}:estimate`, statelessEstimate, {
52
+ headers: { 'Content-Type': 'application/json' },
53
+ });
55
54
 
56
55
  return JSON.parse(
57
56
  JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
@@ -2,10 +2,9 @@ import axios from 'axios';
2
2
  import he from 'he';
3
3
 
4
4
  export const sendAppointmentQualificationEvent = async (event) => {
5
- const response = await request
6
- .post('/api/events/appointment-qualification-events')
7
- .set('Content-Type', 'application/json')
8
- .send(event);
5
+ const response = await axios.post('/api/events/appointment-qualification-events', event, {
6
+ headers: { 'Content-Type': 'application/json' },
7
+ });
9
8
 
10
9
  return JSON.parse(
11
10
  JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
@@ -15,10 +14,9 @@ export const sendAppointmentQualificationEvent = async (event) => {
15
14
  };
16
15
 
17
16
  export const sendAppointmentQualificationAnswers = async (event) => {
18
- const response = await request
19
- .post('/api/events/appointment-qualification-answers')
20
- .set('Content-Type', 'application/json')
21
- .send(event);
17
+ const response = await axios.post('/api/events/appointment-qualification-answers', event, {
18
+ headers: { 'Content-Type': 'application/json' },
19
+ });
22
20
 
23
21
  return JSON.parse(
24
22
  JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
@@ -40,10 +38,9 @@ export const sendDocumentsEvent = async (event) => {
40
38
  };
41
39
 
42
40
  export const sendCardClickEvent = async (event) => {
43
- const response = await request
44
- .post('/api/events/pushed-card-clicks')
45
- .set('Content-Type', 'application/json')
46
- .send(event);
41
+ const response = await axios.post('/api/events/pushed-card-clicks', event, {
42
+ headers: { 'Content-Type': 'application/json' },
43
+ });
47
44
 
48
45
  return JSON.parse(
49
46
  JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
@@ -53,10 +50,9 @@ export const sendCardClickEvent = async (event) => {
53
50
  };
54
51
 
55
52
  export const sendDeclarationEvent = async (event) => {
56
- const response = await request
57
- .post('/api/events/project-declarations')
58
- .set('Content-Type', 'application/json')
59
- .send(event);
53
+ const response = await axios.post('/api/events/project-declarations', event, {
54
+ headers: { 'Content-Type': 'application/json' },
55
+ });
60
56
 
61
57
  return JSON.parse(
62
58
  JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
@@ -23,15 +23,15 @@ const getMediumById = async (mediumId) => {
23
23
 
24
24
  const uploadMedia = async (formData, inhabitantProjectId, correlationId, fileName, isRoomPicture, trackProgress) => {
25
25
  const [name, file] = formData.entries().next().value;
26
-
27
- return await request
28
- .post('/api/media')
29
- .attach(name, file)
30
- .field(
31
- 'metadata',
32
- JSON.stringify({ inhabitantProjectId, correlationId, title: fileName, roomPicture: isRoomPicture }, null, '\t'),
33
- )
34
- .on('progress', trackProgress);
26
+ const data = new FormData();
27
+ data.append(name, file);
28
+ data.append(
29
+ 'metadata',
30
+ JSON.stringify({ inhabitantProjectId, correlationId, title: fileName, roomPicture: isRoomPicture }, null, '\t'),
31
+ );
32
+ return await axios.post('/api/media', data, {
33
+ onUploadProgress: trackProgress,
34
+ });
35
35
  };
36
36
 
37
37
  const updateMediaName = async (mediaId, mediaName) => {
@@ -32,10 +32,9 @@ export const getProductsFeatureFlag = async (projectTypeId) => {
32
32
  };
33
33
 
34
34
  export const saveWorkKinds = async (inhabitantProjectId, workKinds) => {
35
- const response = await request
36
- .put(`/api/inhabitant-projects/${inhabitantProjectId}/work-kinds`)
37
- .set('Content-Type', 'application/json')
38
- .send(workKinds);
35
+ const response = await axios.put(`/api/inhabitant-projects/${inhabitantProjectId}/work-kinds`, workKinds, {
36
+ headers: { 'Content-Type': 'application/json' },
37
+ });
39
38
 
40
39
  return JSON.parse(
41
40
  JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
@@ -46,18 +46,16 @@ export const deleteProjectById = async (id) => {
46
46
  };
47
47
 
48
48
  export const saveInhabitantProject = async (inhabitantProject) => {
49
- const response = await request
50
- .post('/api/inhabitant-projects')
51
- .set('Content-Type', 'application/json')
52
- .send(inhabitantProject);
49
+ const response = await axios.post('/api/inhabitant-projects', inhabitantProject, {
50
+ headers: { 'Content-Type': 'application/json' },
51
+ });
53
52
  return response.headers.location;
54
53
  };
55
54
 
56
55
  export const saveProjectDeclaration = async (projectDeclaration) => {
57
- const response = await request
58
- .post('/api/declarations')
59
- .set('Content-Type', 'application/json')
60
- .send(projectDeclaration);
56
+ const response = await axios.post('/api/declarations', projectDeclaration, {
57
+ headers: { 'Content-Type': 'application/json' },
58
+ });
61
59
 
62
60
  return JSON.parse(
63
61
  JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {