requêtes data terminés
This commit is contained in:
parent
9c96f03d5f
commit
7da9ce40fb
0
.history/IOT/src/data/createData_20230424120319.js
Normal file
0
.history/IOT/src/data/createData_20230424120319.js
Normal file
13
.history/IOT/src/data/createData_20230424120329.js
Normal file
13
.history/IOT/src/data/createData_20230424120329.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import PocketBase from 'pocketbase';
|
||||||
|
|
||||||
|
const pb = new PocketBase('https://iot.epi.cb85.software');
|
||||||
|
|
||||||
|
// example create data
|
||||||
|
const data = {
|
||||||
|
"trash_id": "RELATION_RECORD_ID",
|
||||||
|
"unit": "test",
|
||||||
|
"status": true,
|
||||||
|
"value": "test"
|
||||||
|
};
|
||||||
|
|
||||||
|
const record = await pb.collection('data').create(data);
|
0
.history/IOT/src/data/deleteData_20230424120232.js
Normal file
0
.history/IOT/src/data/deleteData_20230424120232.js
Normal file
5
.history/IOT/src/data/deleteData_20230424120242.js
Normal file
5
.history/IOT/src/data/deleteData_20230424120242.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import PocketBase from 'pocketbase';
|
||||||
|
|
||||||
|
const pb = new PocketBase('https://iot.epi.cb85.software');
|
||||||
|
|
||||||
|
await pb.collection('data').delete('RECORD_ID');
|
13
IOT/src/data/createData.js
Normal file
13
IOT/src/data/createData.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import PocketBase from 'pocketbase';
|
||||||
|
|
||||||
|
const pb = new PocketBase('https://iot.epi.cb85.software');
|
||||||
|
|
||||||
|
// example create data
|
||||||
|
const data = {
|
||||||
|
"trash_id": "RELATION_RECORD_ID",
|
||||||
|
"unit": "test",
|
||||||
|
"status": true,
|
||||||
|
"value": "test"
|
||||||
|
};
|
||||||
|
|
||||||
|
const record = await pb.collection('data').create(data);
|
5
IOT/src/data/deleteData.js
Normal file
5
IOT/src/data/deleteData.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import PocketBase from 'pocketbase';
|
||||||
|
|
||||||
|
const pb = new PocketBase('https://iot.epi.cb85.software');
|
||||||
|
|
||||||
|
await pb.collection('data').delete('RECORD_ID');
|
Loading…
x
Reference in New Issue
Block a user