From 2a2303d1dccc120dd7aa5f6b6ade0f89e0064850 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 25 Nov 2025 07:42:23 +0000
Subject: [PATCH] =Feed block mostly good! Referrals look good to go. Ready for Madi and Heidi to approve
---
assets/js/concise/Queue.js | 25 +++++++------------------
1 files changed, 7 insertions(+), 18 deletions(-)
diff --git a/assets/js/concise/Queue.js b/assets/js/concise/Queue.js
index 56dcb97..297885d 100644
--- a/assets/js/concise/Queue.js
+++ b/assets/js/concise/Queue.js
@@ -26,7 +26,8 @@
this.errors = window.jvbError;
// Initialize DataStore for queue persistence
- this.store = window.jvbStore.register('queue', {
+ const store = window.jvbStore.register('queue', {
+ storeName: 'queue',
keyPath: 'id',
endpoint: this.config.endpoint,
TTL: Infinity,
@@ -37,6 +38,7 @@
showLoading: false,
delayFetch: false, // Queue should fetch immediately
});
+ this.store = store.queue;
this.classes = [
'offline',
@@ -306,41 +308,28 @@
async processOperation(operation) {
try {
- //update to uploading
this.updateOperationStatus(operation.id, 'uploading');
- // Get fresh copy from store to restore FormData
- operation = this.getQueue(operation.id);
+ if (operation.data?._isFormData) {
+ operation.data = await this.store.objectToFormData(operation.data);
+ }
- //build request
const url = `${this.config.apiBase}${operation.endpoint}`;
let requestBody;
- console.log(operation.data);
+
if (operation.data instanceof FormData) {
operation.data.append('id', operation.id);
operation.data.append('user', this.user);
requestBody = operation.data;
- // console.log('Sending formData: ');
- // for (const pair of requestBody.entries()) {
- // console.log(pair[0], pair[1]);
- // }
-
} else {
requestBody = JSON.stringify({
...operation.data,
id: operation.id,
user: this.user
});
- // console.log('Sending data: ', {
- // ...operation.data,
- // id: operation.id,
- // user: this.user
- // });
operation.headers['Content-Type'] = 'application/json';
}
-
-
const response = await fetch(url, {
method: operation.method,
headers: operation.headers,
--
Gitblit v1.10.0