feat: add roles documentation and database configuration files while removing deployment guide
This commit is contained in:
@@ -8,13 +8,13 @@ export async function getTopics() {
|
||||
|
||||
export async function saveTopics(topics) {
|
||||
const existing = await pb.collection('topics').getFullList({ fields: 'id' });
|
||||
await Promise.all(existing.map(r => pb.collection('topics').delete(r.id)));
|
||||
await Promise.all(existing.map(r => pb.collection('topics').delete(r.id, { requestKey: null })));
|
||||
return Promise.all(topics.map(t => pb.collection('topics').create({
|
||||
id: t.id,
|
||||
label: t.label,
|
||||
type: t.type,
|
||||
description: t.description,
|
||||
})));
|
||||
}, { requestKey: null })));
|
||||
}
|
||||
|
||||
export async function upsertTopic(topic) {
|
||||
@@ -34,8 +34,8 @@ export async function getRelations() {
|
||||
|
||||
export async function saveRelations(relations) {
|
||||
const existing = await pb.collection('relations').getFullList({ fields: 'id' });
|
||||
await Promise.all(existing.map(r => pb.collection('relations').delete(r.id)));
|
||||
return Promise.all(relations.map(r => pb.collection('relations').create(r)));
|
||||
await Promise.all(existing.map(r => pb.collection('relations').delete(r.id, { requestKey: null })));
|
||||
return Promise.all(relations.map(r => pb.collection('relations').create(r, { requestKey: null })));
|
||||
}
|
||||
|
||||
export async function addRelation(relation) {
|
||||
@@ -46,7 +46,7 @@ export async function removeRelation(source, target, type) {
|
||||
const records = await pb.collection('relations').getFullList({
|
||||
filter: `source="${source}" && target="${target}" && type="${type}"`,
|
||||
});
|
||||
return Promise.all(records.map(r => pb.collection('relations').delete(r.id)));
|
||||
return Promise.all(records.map(r => pb.collection('relations').delete(r.id, { requestKey: null })));
|
||||
}
|
||||
|
||||
// ── Content ──────────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user