18 lines
418 B
TypeScript
18 lines
418 B
TypeScript
import { Injectable } from '@nestjs/common';
|
|
import { PrismaService } from '../prisma.service';
|
|
|
|
@Injectable()
|
|
export class PostsService {
|
|
constructor(private readonly prisma: PrismaService) {}
|
|
|
|
async create(data: { text?: string; media?: string; mediaType?: string; code?: string }) {
|
|
return this.prisma.post.create({
|
|
data,
|
|
});
|
|
}
|
|
|
|
async findAll() {
|
|
return this.prisma.post.findMany();
|
|
}
|
|
}
|