mirror of
https://github.com/MrSedan/neuro-reply-website.git
synced 2026-01-14 20:49:42 +03:00
Fix for posts not found
This commit is contained in:
@@ -99,7 +99,7 @@ export class PostService {
|
||||
async post() {
|
||||
try {
|
||||
const posts = await this.postRepository.find({ order: { timestamp: 'ASC' }, where: { posted: false }, relations: { images: true } });
|
||||
if (!posts) throw new HttpException('Nothing to post', HttpStatus.NOT_FOUND);
|
||||
if (!posts.length) throw new HttpException('Nothing to post', HttpStatus.NOT_FOUND);
|
||||
const post = posts[0];
|
||||
post.posted = true;
|
||||
this.logger.log(`[post.post] Post ${post.uuid} is posted`);
|
||||
|
||||
Reference in New Issue
Block a user