RJBULK-APP/diag.mjs
SJCoetz 1efa979443 feat: initial setup of rj bulk supplies backoffice app
Adds complete initial codebase for the RJ Bulk Supplies fuel delivery backoffice:
- Authentication pages and protected route layouts
- Customer, supplier, fuel purchase, and delivery note management
- Custom reporting and customer statement sending tools
- Full UI component library and Tailwind styling
- Server actions, API routes, and PocketBase integration
- Development scripts and project configuration updates
- Updated README and package metadata
2026-07-19 20:38:16 +02:00

38 lines
1.2 KiB
JavaScript

import PocketBase from "pocketbase";
const PB_URL = "http://pocketbase-zinlbpsext2ro0lgb2558vfy.169.239.180.130.sslip.io";
const pb = new PocketBase(PB_URL);
await pb.admins.authWithPassword("David.els1@outlook.com", "1234567890");
// Capture the actual HTTP request
const origSend = pb.send;
pb.send = function (path, options) {
console.log("===REQUEST===");
console.log("Path:", path);
console.log("Method:", options.method);
console.log("Body:", JSON.stringify(options.body, null, 2));
return origSend.call(this, path, options).then(r => {
console.log("===RESPONSE===");
console.log("Status:", r.status);
return r;
}).catch(e => {
console.log("===ERROR===");
console.log("Status:", e.status);
console.log("Data:", JSON.stringify(e.response?.data, null, 2));
throw e;
});
};
try { await pb.collections.delete("test_dbg"); } catch (e) {}
try {
const created = await pb.collections.create({
name: "test_dbg",
type: "base",
fields: [
{ name: "rel", type: "relation", options: { collectionId: "pbc_108570809", cascadeDelete: false, maxSelect: 1 } },
],
});
console.log("Created:", created.id);
await pb.collections.delete("test_dbg");
} catch (err) {
console.log("Failed");
}