chore(workspace): eradicate all tsc errors and eslint warnings across frontend, admin, and backend
Deploy Canina / deploy (push) Failing after 29s

This commit is contained in:
parsa committed 2026-08-07 07:39:26 +03:30
1 parent 4659a7b1de
commit 9f11d8fb2d
98 files changed
+1272 -1009

No files matched your search

+17 -9
View File
@@ -1,23 +1,31 @@
import { Injectable, NotFoundException } from '@nestjs/common';
import { Prisma } from '@prisma/client';
import { PrismaService } from '../prisma/prisma.service';
export class PetQuery {
page?: number | string;
limit?: number | string;
search?: string;
}
@Injectable()
export class PetsService {
constructor(private prisma: PrismaService) {}
async getPets(query: any) {
const { page = 1, limit = 10, search = '' } = query;
const skip = (Number(page) - 1) * Number(limit);
async getPets(query: PetQuery = {}) {
const page = Number(query.page) || 1;
const limit = Number(query.limit) || 10;
const skip = (page - 1) * limit;
const where = search
? { name: { contains: search, mode: 'insensitive' as any } }
const where: Prisma.PetWhereInput = query.search
? { name: { contains: query.search, mode: 'insensitive' } }
: {};
const [data, total] = await Promise.all([
this.prisma.pet.findMany({
where,
skip,
take: Number(limit),
take: limit,
orderBy: { createdAt: 'desc' },
include: {
user: {
@@ -37,9 +45,9 @@ export class PetsService {
data,
meta: {
total,
page: Number(page),
limit: Number(limit),
lastPage: Math.ceil(total / Number(limit)),
page,
limit,
lastPage: Math.ceil(total / limit),
},
};
}