first commit

This commit is contained in:
NAME
2026-05-14 08:42:03 +00:00
commit 5f16ed135d
167 changed files with 29178 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import {Injectable} from "@nestjs/common";
import {PrismaService} from "../../prisma/prisma.service";
import {Post, Prisma} from "../generated/prisma/client";
@Injectable()
export class PgPostService {
constructor(private prisma: PrismaService) {
}
async post(postWhereUniqueInput: Prisma.PostWhereUniqueInput): Promise<Post | null> {
return this.prisma.post.findUnique({
where: postWhereUniqueInput,
});
}
async createPost(data: Prisma.PostCreateInput): Promise<Post> {
return this.prisma.post.create({
data,
});
}
async updatePost(id, data: Prisma.PostUpdateInput): Promise<Post> {
return this.prisma.post.update({
data,
where: {
id
}
});
}
}