Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Fix imports fetch for site

Edward Cui6bbeb6156f98
diff --git a/server/src/api/import/listImports.ts b/server/src/api/import/listImports.ts
index 68cbcff9c..a7dfb0572 100644
--- a/server/src/api/import/listImports.ts
+++ b/server/src/api/import/listImports.ts
@@ -38,10 +38,7 @@ export async function listImports(
return reply.status(403).send({ error: "Forbidden" });
}
- const imports = await ImportStatusManager.getImportsForSite(
- Number(site),
- organization,
- );
+ const imports = await ImportStatusManager.getImportsForSite(Number(site));
return reply.send({
imports: imports.map(imp => ({
diff --git a/server/src/lib/importStatus.ts b/server/src/lib/importStatus.ts
index ad96266ed..e803cdafa 100644
--- a/server/src/lib/importStatus.ts
+++ b/server/src/lib/importStatus.ts
@@ -53,16 +53,9 @@ export class ImportStatusManager {
return result || null;
}
- static async getImportsForSite(
- siteId: number,
- organization: string,
- limit = 50
- ): Promise<SelectImportStatus[]> {
+ static async getImportsForSite(siteId: number, limit = 50): Promise<SelectImportStatus[]> {
return db.query.importStatus.findMany({
- where: and(
- eq(importStatus.siteId, siteId),
- eq(importStatus.organizationId, organization)
- ),
+ where: eq(importStatus.siteId, siteId),
orderBy: [desc(importStatus.startedAt)],
limit,
});