summaryrefslogtreecommitdiffstats
path: root/webapp/utils
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/utils')
-rw-r--r--webapp/utils/async_client.jsx1
-rw-r--r--webapp/utils/client.jsx19
2 files changed, 19 insertions, 1 deletions
diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx
index 5b0c221ae..80a08dc21 100644
--- a/webapp/utils/async_client.jsx
+++ b/webapp/utils/async_client.jsx
@@ -1334,4 +1334,3 @@ export function regenCommandToken(id) {
}
);
}
-
diff --git a/webapp/utils/client.jsx b/webapp/utils/client.jsx
index 6c784c11c..687d47da4 100644
--- a/webapp/utils/client.jsx
+++ b/webapp/utils/client.jsx
@@ -1738,3 +1738,22 @@ export function updateMfa(data, success, error) {
}
});
}
+
+export function uploadBrandImage(image, success, error) {
+ const formData = new FormData();
+ formData.append('image', image, image.name);
+
+ $.ajax({
+ url: '/api/v1/admin/upload_brand_image',
+ type: 'POST',
+ data: formData,
+ cache: false,
+ contentType: false,
+ processData: false,
+ success,
+ error: function onError(xhr, status, err) {
+ var e = handleError('uploadBrandImage', xhr, status, err);
+ error(e);
+ }
+ });
+}