@opencitylabs/formio-sdk 1.2.0 → 1.2.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.
Files changed (2) hide show
  1. package/index.js +7 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -79,7 +79,8 @@ class FormIoHelper {
79
79
  const response = await axios.get(this.basePath + '/api/' + endPoint, {
80
80
  headers: {
81
81
  "Content-Type": "application/json",
82
- "Authorization": "Bearer " + token
82
+ "Authorization": "Bearer " + token,
83
+ "x-locale": this.getCurrentLocale()
83
84
  }
84
85
  })
85
86
  return response.data
@@ -92,7 +93,8 @@ class FormIoHelper {
92
93
  const response = await axios.post(this.basePath + '/api/' + endPoint, JSON.stringify(params),{
93
94
  headers: {
94
95
  "Content-Type": "application/json",
95
- "Authorization": "Bearer " + token
96
+ "Authorization": "Bearer " + token,
97
+ "x-locale": this.getCurrentLocale()
96
98
  }
97
99
  })
98
100
  return response.data
@@ -115,6 +117,7 @@ class FormIoHelper {
115
117
  headers: {
116
118
  "Content-Type": "application/json",
117
119
  Authorization: `Bearer ${token}`,
120
+ "x-locale": this.getCurrentLocale()
118
121
  },
119
122
  });
120
123
 
@@ -161,7 +164,8 @@ class FormIoHelper {
161
164
  async anonymousCall(endPoint) {
162
165
  const response = await axios.get(this.basePath + '/api/' + endPoint, {
163
166
  headers: {
164
- "Content-Type": "application/json"
167
+ "Content-Type": "application/json",
168
+ "x-locale": this.getCurrentLocale()
165
169
  }
166
170
  })
167
171
  return response.data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencitylabs/formio-sdk",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Node/browser SDK helper for Form.io APIs",
5
5
  "type": "module",
6
6
  "main": "index.js",