Skip to content

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

fix(api): return only the needed fields from channel delete and the organizations list

Gilad Resisi8ad0df3df0f2
diff --git a/apps/backend/src/api/routes/users.controller.ts b/apps/backend/src/api/routes/users.controller.ts
index ca15e470e..96fa7daaa 100644
--- a/apps/backend/src/api/routes/users.controller.ts
+++ b/apps/backend/src/api/routes/users.controller.ts
@@ -298,9 +298,14 @@ export class UsersController {
@Get('/organizations')
async getOrgs(@GetUserFromRequest() user: User) {
- return (await this._orgService.getOrgsByUserId(user.id)).filter(
- (f) => !f.users[0].disabled
- );
+ return (await this._orgService.getOrgsByUserId(user.id))
+ .filter((f) => !f.users[0].disabled)
+ .map((p) => ({
+ id: p.id,
+ name: p.name,
+ users: p.users,
+ subscription: p.subscription,
+ }));
}
@Post('/change-org')
diff --git a/libraries/nestjs-libraries/src/database/prisma/integrations/integration.repository.ts b/libraries/nestjs-libraries/src/database/prisma/integrations/integration.repository.ts
index 0a9f2b1fc..818d87ef7 100644
--- a/libraries/nestjs-libraries/src/database/prisma/integrations/integration.repository.ts
+++ b/libraries/nestjs-libraries/src/database/prisma/integrations/integration.repository.ts
@@ -765,6 +765,9 @@ export class IntegrationRepository {
deleteChannel(org: string, id: string) {
return this._integration.model.integration.update({
+ select: {
+ id: true,
+ },
where: {
id,
organizationId: org,