generated from template/apps-template
update
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
// import { Life, NocoApi } from '@kevisual/noco/mod.ts';
|
||||
import { Life, NocoApi } from '../mod.ts';
|
||||
import { generateMultipleRandomItems } from './random-data';
|
||||
|
||||
// const token = 'your'
|
||||
// const baseId = 'your_base_id';
|
||||
|
||||
const token = 'CPrDfoajtCjayEYK17wOljE7R2E7DoTIw_7oUnjb'
|
||||
const baseId = 'p1pderowf0zhugt'
|
||||
let tableId = 'mierezd5z73kj26'
|
||||
const token = 'bMLb3rzj9Qz_nOuQ0dj9PRYQbPK_79C2Yfbq5Xae'
|
||||
const baseId = 'p7k66s6p7lss31j'
|
||||
const nocoApi = new NocoApi({
|
||||
baseURL: 'http://localhost:8080',
|
||||
token
|
||||
@@ -14,18 +13,12 @@ const nocoApi = new NocoApi({
|
||||
|
||||
const life = new Life({ nocoApi, baseId });
|
||||
|
||||
// const tableRes = await life.createTable({
|
||||
// title: '测试表格2',
|
||||
// });
|
||||
// tableId = tableRes.data?.id || '';
|
||||
// console.log('tableId', tableId);
|
||||
|
||||
life.nocoApi.record.table = tableId;
|
||||
const datas = generateMultipleRandomItems(1);
|
||||
const tableRes = await life.createTable();
|
||||
console.log('tableRes', tableRes);
|
||||
|
||||
const datas = generateMultipleRandomItems(100);
|
||||
for (const data of datas) {
|
||||
console.log('data', data);
|
||||
const createRes = await life.nocoApi.record.create(data);
|
||||
console.log('createRes', createRes);
|
||||
const createRes = await life.creatItem(data);
|
||||
console.log(createRes);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user