feat: initialize database connection module for data persistence
This commit is contained in:
@@ -3,7 +3,7 @@ import { pb } from './pb';
|
|||||||
// ── Topics ──────────────────────────────────────────────────────────────────
|
// ── Topics ──────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
export async function getTopics() {
|
export async function getTopics() {
|
||||||
return pb.collection('topics').getFullList({ sort: 'created' });
|
return pb.collection('topics').getFullList();
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function saveTopics(topics) {
|
export async function saveTopics(topics) {
|
||||||
@@ -100,7 +100,7 @@ export async function deleteQuestionFromBank(topicId, questionId) {
|
|||||||
// ── Sources ──────────────────────────────────────────────────────────────────
|
// ── Sources ──────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
export async function getSources() {
|
export async function getSources() {
|
||||||
return pb.collection('sources').getFullList({ sort: '-created' });
|
return pb.collection('sources').getFullList();
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function addSource(source) {
|
export async function addSource(source) {
|
||||||
@@ -118,7 +118,7 @@ export async function deleteSource(id) {
|
|||||||
// ── Team Members ─────────────────────────────────────────────────────────────
|
// ── Team Members ─────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
export async function getTeamMembers() {
|
export async function getTeamMembers() {
|
||||||
return pb.collection('team_members').getFullList({ sort: 'created' });
|
return pb.collection('team_members').getFullList();
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function addTeamMember(member) {
|
export async function addTeamMember(member) {
|
||||||
|
|||||||
Reference in New Issue
Block a user