mirror of
https://github.com/MrSedan/neuro-reply-website.git
synced 2026-01-15 04:59:42 +03:00
Create modules,providers, services for bd
This commit is contained in:
15
backend/src/db_service/post.service.ts
Normal file
15
backend/src/db_service/post.service.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Injectable, Inject } from '@nestjs/common';
|
||||
import { Repository } from 'typeorm';
|
||||
import { Post } from '../db.entity';
|
||||
import { postRep } from '../constants';
|
||||
@Injectable()
|
||||
export class PostService {
|
||||
constructor(
|
||||
@Inject(postRep)
|
||||
private photoRepository: Repository<Post>,
|
||||
) {}
|
||||
|
||||
async findAll(): Promise<Post[]> {
|
||||
return this.photoRepository.find();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user