mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-25 10:04:43 +00:00
PocketBase Bot: fix field names notes_json -> notes, install_methods_json -> install_methods
Collection fields were renamed but bot still used old _json suffixed names.
This commit is contained in:
Generated
+6
-6
@@ -337,8 +337,8 @@ jobs:
|
|||||||
|
|
||||||
if (infoMatch) {
|
if (infoMatch) {
|
||||||
// ── INFO SUBCOMMAND ──────────────────────────────────────────────
|
// ── INFO SUBCOMMAND ──────────────────────────────────────────────
|
||||||
const notesArr = readJsonBlob(record.notes_json);
|
const notesArr = readJsonBlob(record.notes);
|
||||||
const methodsArr = readJsonBlob(record.install_methods_json);
|
const methodsArr = readJsonBlob(record.install_methods);
|
||||||
|
|
||||||
const out = [];
|
const out = [];
|
||||||
out.push('ℹ️ **PocketBase Bot**: Info for **`' + slug + '`**\n');
|
out.push('ℹ️ **PocketBase Bot**: Info for **`' + slug + '`**\n');
|
||||||
@@ -382,13 +382,13 @@ jobs:
|
|||||||
// ── NOTE SUBCOMMAND ──────────────────────────────────────────────
|
// ── NOTE SUBCOMMAND ──────────────────────────────────────────────
|
||||||
const noteAction = noteMatch[1].toLowerCase();
|
const noteAction = noteMatch[1].toLowerCase();
|
||||||
const noteArgsStr = rest.substring(noteMatch[0].length).trim();
|
const noteArgsStr = rest.substring(noteMatch[0].length).trim();
|
||||||
let notesArr = readJsonBlob(record.notes_json);
|
let notesArr = readJsonBlob(record.notes);
|
||||||
|
|
||||||
async function patchNotes(arr) {
|
async function patchNotes(arr) {
|
||||||
const res = await request(recordsUrl + '/' + record.id, {
|
const res = await request(recordsUrl + '/' + record.id, {
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
headers: { 'Authorization': token, 'Content-Type': 'application/json' },
|
headers: { 'Authorization': token, 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({ notes_json: arr })
|
body: JSON.stringify({ notes: arr })
|
||||||
});
|
});
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
await addReaction('-1');
|
await addReaction('-1');
|
||||||
@@ -504,7 +504,7 @@ jobs:
|
|||||||
// ── METHOD SUBCOMMAND ────────────────────────────────────────────
|
// ── METHOD SUBCOMMAND ────────────────────────────────────────────
|
||||||
const methodArgs = rest.replace(/^method\s*/i, '').trim();
|
const methodArgs = rest.replace(/^method\s*/i, '').trim();
|
||||||
const methodListMode = !methodArgs || methodArgs.toLowerCase() === 'list';
|
const methodListMode = !methodArgs || methodArgs.toLowerCase() === 'list';
|
||||||
let methodsArr = readJsonBlob(record.install_methods_json);
|
let methodsArr = readJsonBlob(record.install_methods);
|
||||||
|
|
||||||
// Method field classification
|
// Method field classification
|
||||||
const RESOURCE_KEYS = { cpu: 'number', ram: 'number', hdd: 'number', os: 'string', version: 'string' };
|
const RESOURCE_KEYS = { cpu: 'number', ram: 'number', hdd: 'number', os: 'string', version: 'string' };
|
||||||
@@ -526,7 +526,7 @@ jobs:
|
|||||||
const res = await request(recordsUrl + '/' + record.id, {
|
const res = await request(recordsUrl + '/' + record.id, {
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
headers: { 'Authorization': token, 'Content-Type': 'application/json' },
|
headers: { 'Authorization': token, 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({ install_methods_json: arr })
|
body: JSON.stringify({ install_methods: arr })
|
||||||
});
|
});
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
await addReaction('-1');
|
await addReaction('-1');
|
||||||
|
|||||||
Reference in New Issue
Block a user