Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

feat: fix post list

Nevo David78238963df75
diff --git a/libraries/nestjs-libraries/src/database/prisma/posts/posts.repository.ts b/libraries/nestjs-libraries/src/database/prisma/posts/posts.repository.ts
index c11a31662..4cd90cc78 100644
--- a/libraries/nestjs-libraries/src/database/prisma/posts/posts.repository.ts
+++ b/libraries/nestjs-libraries/src/database/prisma/posts/posts.repository.ts
@@ -138,7 +138,7 @@ export class PostsRepository {
OR: [
{
organizationId: orgId,
- }
+ },
],
},
{
@@ -159,6 +159,7 @@ export class PostsRepository {
],
integration: {
deletedAt: null,
+ organizationId: orgId,
},
deletedAt: null,
parentPostId: null,
@@ -229,7 +230,6 @@ export class PostsRepository {
stateFilter === 'scheduled'
? {
state: State.QUEUE,
- publishDate: { gte: dayjs.utc().toDate() },
}
: stateFilter === 'draft'
? { state: State.DRAFT }
@@ -255,16 +255,20 @@ export class PostsRepository {
},
],
...stateAndDate,
+ publishDate: { gte: dayjs.utc().toDate() },
deletedAt: null as Date | null,
parentPostId: null as string | null,
intervalInDays: null as number | null,
- ...(query.customer
- ? {
- integration: {
+
+ integration: {
+ deletedAt: null as any,
+ organizationId: orgId,
+ ...(query.customer
+ ? {
customerId: query.customer,
- },
- }
- : {}),
+ }
+ : {}),
+ },
};
const [posts, total] = await Promise.all([
@@ -282,6 +286,7 @@ export class PostsRepository {
releaseURL: true,
releaseId: true,
state: true,
+ intervalInDays: true,
group: true,
creationMethod: true,
tags: {