feat: complete backend swagger annotations, admin pages pagination, and frontend application fixes

This commit is contained in:
parsa committed 2026-07-10 16:13:52 +03:30
1 parent 24137beb32
commit 2851ef8a25
41 files changed
+478 -128

No files matched your search

+4 -4
View File
@@ -57,7 +57,7 @@ export class AdminService {
this.prisma.user.count({ where })
]);
return { data, meta: { total, page, limit, totalPages: Math.ceil(total / limit) } };
return { data, meta: { total, page, limit, lastPage: Math.ceil(total / limit) } };
}
async updateUserRole(id: string, role: string) {
@@ -92,7 +92,7 @@ export class AdminService {
this.prisma.product.count({ where })
]);
return { data, meta: { total, page, limit, totalPages: Math.ceil(total / limit) } };
return { data, meta: { total, page, limit, lastPage: Math.ceil(total / limit) } };
} catch (error) {
console.error("[AdminService] getProducts error:", error);
throw new HttpException(error.message || 'Error fetching products', 500);
@@ -179,7 +179,7 @@ export class AdminService {
this.prisma.order.count({ where })
]);
return { data, meta: { total, page, limit, totalPages: Math.ceil(total / limit) } };
return { data, meta: { total, page, limit, lastPage: Math.ceil(total / limit) } };
}
async updateOrderStatus(id: string, status: string) {
@@ -209,7 +209,7 @@ export class AdminService {
return {
data,
meta: { total, page: Number(page), limit: Number(limit), totalPages: Math.ceil(total / Number(limit)) }
meta: { total, page: Number(page), limit: Number(limit), lastPage: Math.ceil(total / Number(limit)) }
};
}