Browse Source

Renumerate script

master
mcarquigny 1 week ago
parent
commit
9fe860b526
  1. 2
      scripts/import_categories.js
  2. 2
      scripts/import_history.js
  3. 2
      scripts/import_history_files.js
  4. 2
      scripts/import_stock.js
  5. 2
      scripts/renumerate.js

2
scripts/import_categories.js

@ -6,7 +6,7 @@ const pb = new PocketBase('http://127.0.0.1:8090')
async function main () {
try {
// Authenticate as an admin
await pb.admins.authWithPassword('karkinge@gmail.com', 'PBk4rk1ng3*') // Replace with your admin credentials
await pb.admins.authWithPassword('karkinge@gmail.com', 'XXXXXXX') // Replace with your admin credentials
// Parse JSON file with categories
const data = require('../../gyoza/database_backups/20250320.json')

2
scripts/import_history.js

@ -6,7 +6,7 @@ const pb = new PocketBase('http://127.0.0.1:8090')
async function main () {
try {
// Authenticate as an admin
await pb.admins.authWithPassword('karkinge@gmail.com', 'PBk4rk1ng3*') // Replace with your admin credentials
await pb.admins.authWithPassword('karkinge@gmail.com', 'XXXXXXX') // Replace with your admin credentials
// Parse JSON file with categories
const data = require('../../gyoza/database_backups/20250320.json')

2
scripts/import_history_files.js

@ -7,7 +7,7 @@ const pb = new PocketBase('http://127.0.0.1:8090')
async function main () {
try {
// Authenticate as an admin
await pb.admins.authWithPassword('karkinge@gmail.com', 'PBk4rk1ng3*') // Replace with your admin credentials
await pb.admins.authWithPassword('karkinge@gmail.com', 'XXXXXXX') // Replace with your admin credentials
// Parse JSON file with categories
const filesPath = '../gyoza/storage/'

2
scripts/import_stock.js

@ -6,7 +6,7 @@ const pb = new PocketBase('http://127.0.0.1:8090')
async function main () {
try {
// Authenticate as an admin
await pb.admins.authWithPassword('karkinge@gmail.com', 'PBk4rk1ng3*') // Replace with your admin credentials
await pb.admins.authWithPassword('karkinge@gmail.com', 'XXXXXXX') // Replace with your admin credentials
// Parse JSON file with categories
const data = require('../../gyoza/database_backups/20250320.json')

2
scripts/renumerate.js

@ -8,7 +8,7 @@ async function main () {
try {
// Authenticate as an admin
// await pb.admins.authWithPassword('gyoza@hfsplay.fr', 'gyozagyoza') // Replace with your admin credentials
await pb.collection('_superusers').authWithPassword('karkinge@gmail.com', 'k4rk1ng3*') // Replace with your admin credentials
await pb.collection('_superusers').authWithPassword('karkinge@gmail.com', 'XXXXXXX') // Replace with your admin credentials
console.log('connected !')
let stock = await pb.collection('stock').getFullList({
sort: 'created'

Loading…
Cancel
Save