Massive feature update: Solo session recovery, immediate result saving, image proxy, player reconnection (Live), and UI/UX refinements
This commit is contained in:
+9
-2
@@ -9,7 +9,6 @@ async function baserowFetch(endpoint, options = {}) {
|
||||
Authorization: `Token ${baserowToken}`,
|
||||
...(options.headers || {}),
|
||||
};
|
||||
// Only set Content-Type for requests with body
|
||||
if (options.body) {
|
||||
headers['Content-Type'] = 'application/json';
|
||||
}
|
||||
@@ -42,6 +41,14 @@ async function listRows(tableId, filters = {}) {
|
||||
return all;
|
||||
}
|
||||
|
||||
async function createRow(tableId, row) {
|
||||
console.log(`[baserow] Create row in table ${tableId}`);
|
||||
return baserowFetch(`/database/rows/table/${tableId}/?user_field_names=true`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(row),
|
||||
});
|
||||
}
|
||||
|
||||
async function batchCreateRows(tableId, rows) {
|
||||
if (!rows.length) return;
|
||||
console.log(`[baserow] Batch create ${rows.length} rows in table ${tableId}`);
|
||||
@@ -54,4 +61,4 @@ async function batchCreateRows(tableId, rows) {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { listRows, batchCreateRows };
|
||||
module.exports = { listRows, createRow, batchCreateRows };
|
||||
Reference in New Issue
Block a user