@formio/js 5.1.0-dev.6180.de668a0 → 5.1.0-dev.6181.dd734d1

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.
@@ -127,13 +127,17 @@ function url(formio) {
127
127
  deleteFile(fileInfo, options) {
128
128
  return new Promise((resolve, reject) => {
129
129
  const xhr = new XMLHttpRequest();
130
- xhr.open('DELETE', fileInfo.url, true);
130
+ xhr.open("DELETE", fileInfo.url, true);
131
+ const token = formio.getToken();
132
+ if (token) {
133
+ xhr.setRequestHeader("x-jwt-token", token);
134
+ }
131
135
  xhr.onload = () => {
132
136
  if (xhr.status >= 200 && xhr.status < 300) {
133
- resolve('File deleted');
137
+ resolve("File deleted");
134
138
  }
135
139
  else {
136
- reject(xhr.response || 'Unable to delete file');
140
+ reject(xhr.response || "Unable to delete file");
137
141
  }
138
142
  };
139
143
  if (options) {
@@ -125,13 +125,17 @@ function url(formio) {
125
125
  deleteFile(fileInfo, options) {
126
126
  return new Promise((resolve, reject) => {
127
127
  const xhr = new XMLHttpRequest();
128
- xhr.open('DELETE', fileInfo.url, true);
128
+ xhr.open("DELETE", fileInfo.url, true);
129
+ const token = formio.getToken();
130
+ if (token) {
131
+ xhr.setRequestHeader("x-jwt-token", token);
132
+ }
129
133
  xhr.onload = () => {
130
134
  if (xhr.status >= 200 && xhr.status < 300) {
131
- resolve('File deleted');
135
+ resolve("File deleted");
132
136
  }
133
137
  else {
134
- reject(xhr.response || 'Unable to delete file');
138
+ reject(xhr.response || "Unable to delete file");
135
139
  }
136
140
  };
137
141
  if (options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.1.0-dev.6180.de668a0",
3
+ "version": "5.1.0-dev.6181.dd734d1",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {