This repository has been archived on 2026-08-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
onlypets/backend/src/posts/posts.controller.ts
T

34 lines
859 B
TypeScript

import { Controller, Get, Query, Req } from '@nestjs/common';
import { PostsService } from './posts.service';
@Controller('posts')
export class PostsController {
constructor(private readonly postsService: PostsService) {}
@Get()
getFeed(
@Req() req,
@Query('take') take?: string,
@Query('cursorId') cursorId?: string,
) {
return this.postsService.getFeed(req.user.id, {
mode: 'mixed',
take: take ? Number(take) : undefined,
cursorId: cursorId ? Number(cursorId) : undefined,
});
}
@Get('discovery')
getDiscovery(
@Req() req,
@Query('take') take?: string,
@Query('cursorId') cursorId?: string,
) {
return this.postsService.getFeed(req.user.id, {
mode: 'discovery',
take: take ? Number(take) : undefined,
cursorId: cursorId ? Number(cursorId) : undefined,
});
}
}