mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-25 18:55:19 +02:00
housekeeping
This commit is contained in:
parent
d4f0db1f09
commit
ab81fa3c46
2 changed files with 1 additions and 6 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
'use server';
|
'use server';
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
import { ObjectId } from "mongodb";
|
import { ObjectId } from "mongodb";
|
||||||
import { db, dataSourcesCollection, embeddingsCollection, projectsCollection, projectMembersCollection, apiKeysCollection, dataSourceDocsCollection } from "../lib/mongodb";
|
import { db, dataSourcesCollection, projectsCollection, projectMembersCollection, apiKeysCollection, dataSourceDocsCollection } from "../lib/mongodb";
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import crypto from 'crypto';
|
import crypto from 'crypto';
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
@ -244,9 +244,6 @@ export async function deleteProject(projectId: string) {
|
||||||
const ids = sources.map(s => s._id);
|
const ids = sources.map(s => s._id);
|
||||||
|
|
||||||
// delete data sources
|
// delete data sources
|
||||||
await embeddingsCollection.deleteMany({
|
|
||||||
sourceId: { $in: ids.map(i => i.toString()) },
|
|
||||||
});
|
|
||||||
await dataSourcesCollection.deleteMany({
|
await dataSourcesCollection.deleteMany({
|
||||||
_id: {
|
_id: {
|
||||||
$in: ids,
|
$in: ids,
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,8 @@ const client = new MongoClient(process.env["MONGODB_CONNECTION_STRING"] || "mong
|
||||||
export const db = client.db("rowboat");
|
export const db = client.db("rowboat");
|
||||||
export const dataSourcesCollection = db.collection<z.infer<typeof DataSource>>("sources");
|
export const dataSourcesCollection = db.collection<z.infer<typeof DataSource>>("sources");
|
||||||
export const dataSourceDocsCollection = db.collection<z.infer<typeof DataSourceDoc>>("source_docs");
|
export const dataSourceDocsCollection = db.collection<z.infer<typeof DataSourceDoc>>("source_docs");
|
||||||
export const embeddingsCollection = db.collection<z.infer<typeof EmbeddingDoc>>("embeddings");
|
|
||||||
export const projectsCollection = db.collection<z.infer<typeof Project>>("projects");
|
export const projectsCollection = db.collection<z.infer<typeof Project>>("projects");
|
||||||
export const projectMembersCollection = db.collection<z.infer<typeof ProjectMember>>("project_members");
|
export const projectMembersCollection = db.collection<z.infer<typeof ProjectMember>>("project_members");
|
||||||
export const webpagesCollection = db.collection<z.infer<typeof Webpage>>('webpages');
|
|
||||||
export const agentWorkflowsCollection = db.collection<z.infer<typeof Workflow>>("agent_workflows");
|
export const agentWorkflowsCollection = db.collection<z.infer<typeof Workflow>>("agent_workflows");
|
||||||
export const apiKeysCollection = db.collection<z.infer<typeof ApiKey>>("api_keys");
|
export const apiKeysCollection = db.collection<z.infer<typeof ApiKey>>("api_keys");
|
||||||
export const chatsCollection = db.collection<z.infer<typeof apiV1.Chat>>("chats");
|
export const chatsCollection = db.collection<z.infer<typeof apiV1.Chat>>("chats");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue