generated from fahricansecer/boilerplate-be
This commit is contained in:
@@ -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 } },
|
||||
|
||||
Reference in New Issue
Block a user