main
Some checks failed
Backend Deploy 🚀 / build-and-deploy (push) Has been cancelled

This commit is contained in:
Harun CAN
2026-03-22 23:37:13 +03:00
parent c3d2413003
commit 9bd2b4a2dd
4 changed files with 14 additions and 6 deletions

View File

@@ -75,7 +75,7 @@ export class ContentService {
* Get user's content with filters
*/
async getByUser(
userId: string,
userId?: string,
options?: {
platform?: SocialPlatform;
status?: ContentStatus;
@@ -85,12 +85,12 @@ export class ContentService {
) {
return this.prisma.content.findMany({
where: {
userId,
...(options?.platform && { platform: options.platform }),
...(userId && { userId }),
...(options?.platform && { type: options.platform as any }),
...(options?.status && { status: options.status }),
},
orderBy: { createdAt: 'desc' },
take: options?.limit || 20,
take: options?.limit || 50,
skip: options?.offset || 0,
include: {
masterContent: { select: { id: true, title: true, type: true } },