feat(perf): implement comprehensive Core Web Vitals, ISR caching, and media optimizations
Deploy Canina / deploy (push) Successful in 1m48s
Deploy Canina / deploy (push) Successful in 1m48s
This commit is contained in:
1 parent
2a31a9f8e4
commit
fe6a900665
42 files changed
+12941
-10561
No files matched your search
@@ -12,6 +12,7 @@ import { CreateUserDto, UpdateUserDto } from './dto/user.dto';
|
||||
import { ProductDto } from './dto/product.dto';
|
||||
import { normalizeMobile } from '../common/utils/phone.utils';
|
||||
import { CANONICAL_ALIASES } from '../settings/settings.service';
|
||||
import { RevalidationService } from '../common/revalidation/revalidation.service';
|
||||
|
||||
export class PaginationQuery {
|
||||
page?: number | string;
|
||||
@@ -51,6 +52,7 @@ export class AdminService {
|
||||
constructor(
|
||||
private prisma: PrismaService,
|
||||
private redisService: RedisService,
|
||||
private revalidationService: RevalidationService,
|
||||
) {}
|
||||
|
||||
async getDashboardStats() {
|
||||
@@ -456,6 +458,10 @@ export class AdminService {
|
||||
});
|
||||
}
|
||||
|
||||
await this.revalidationService.revalidateProduct(
|
||||
product.slug,
|
||||
product.artNo,
|
||||
);
|
||||
return product;
|
||||
}
|
||||
|
||||
@@ -516,11 +522,15 @@ export class AdminService {
|
||||
metaDescription: data.metaDescription,
|
||||
keywords: data.keywords,
|
||||
canonicalUrl: data.canonicalUrl,
|
||||
stockStatus: data.stockStatus !== undefined ? data.stockStatus : undefined,
|
||||
stockStatus:
|
||||
data.stockStatus !== undefined ? data.stockStatus : undefined,
|
||||
noIndex: data.noIndex !== undefined ? data.noIndex : undefined,
|
||||
noFollow: data.noFollow !== undefined ? data.noFollow : undefined,
|
||||
ogImage: data.ogImage !== undefined ? data.ogImage : undefined,
|
||||
featuredImageAlt: data.featuredImageAlt !== undefined ? data.featuredImageAlt : undefined,
|
||||
featuredImageAlt:
|
||||
data.featuredImageAlt !== undefined
|
||||
? data.featuredImageAlt
|
||||
: undefined,
|
||||
slug: data.slug || data.artNo,
|
||||
},
|
||||
});
|
||||
@@ -539,13 +549,25 @@ export class AdminService {
|
||||
}
|
||||
}
|
||||
|
||||
await this.revalidationService.revalidateProduct(
|
||||
product.slug,
|
||||
product.artNo,
|
||||
);
|
||||
return product;
|
||||
}
|
||||
|
||||
async deleteProduct(id: string) {
|
||||
return this.prisma.product.delete({
|
||||
const existing = await this.prisma.product.findUnique({ where: { id } });
|
||||
const res = await this.prisma.product.delete({
|
||||
where: { id },
|
||||
});
|
||||
if (existing) {
|
||||
await this.revalidationService.revalidateProduct(
|
||||
existing.slug,
|
||||
existing.artNo,
|
||||
);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
async getOrders(query: PaginationQuery = {}) {
|
||||
|
||||
Reference in new issue
Block a user