fix(linter): resolve all linter rules and type errors across 3 subprojects
This commit is contained in:
1 parent
5f790a60a9
commit
a1f0640483
17 files changed
+201
-104
No files matched your search
@@ -39,7 +39,9 @@ export class AdminService {
|
||||
const [dogCount, catCount, bothCount] = await Promise.all([
|
||||
this.prisma.product.count({ where: { suitableFor: 'سگ' } }),
|
||||
this.prisma.product.count({ where: { suitableFor: 'گربه' } }),
|
||||
this.prisma.product.count({ where: { suitableFor: { contains: 'هر دو' } } }),
|
||||
this.prisma.product.count({
|
||||
where: { suitableFor: { contains: 'هر دو' } },
|
||||
}),
|
||||
]);
|
||||
|
||||
return {
|
||||
@@ -51,7 +53,7 @@ export class AdminService {
|
||||
{ name: 'مکمل سگ', value: dogCount || 8 },
|
||||
{ name: 'مکمل گربه', value: catCount || 6 },
|
||||
{ name: 'هر دو (سگ و گربه)', value: bothCount || 12 },
|
||||
]
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -156,7 +158,11 @@ export class AdminService {
|
||||
dosageLogic: data.dosageLogic,
|
||||
suitableFor: data.suitableFor,
|
||||
imageUrl: data.imageUrl,
|
||||
images: Array.isArray(data.images) ? data.images : (data.images ? [data.images] : []),
|
||||
images: Array.isArray(data.images)
|
||||
? data.images
|
||||
: data.images
|
||||
? [data.images]
|
||||
: [],
|
||||
podcastUrl: data.podcastUrl || null,
|
||||
videoUrl: data.videoUrl || null,
|
||||
pdfUrl: data.pdfUrl || null,
|
||||
@@ -436,11 +442,26 @@ export class AdminService {
|
||||
});
|
||||
}
|
||||
|
||||
async createDoctor(data: { name: string; title: string; avatarUrl?: string; bio?: string; clinic?: string }) {
|
||||
async createDoctor(data: {
|
||||
name: string;
|
||||
title: string;
|
||||
avatarUrl?: string;
|
||||
bio?: string;
|
||||
clinic?: string;
|
||||
}) {
|
||||
return this.prisma.doctor.create({ data });
|
||||
}
|
||||
|
||||
async updateDoctor(id: string, data: { name?: string; title?: string; avatarUrl?: string; bio?: string; clinic?: string }) {
|
||||
async updateDoctor(
|
||||
id: string,
|
||||
data: {
|
||||
name?: string;
|
||||
title?: string;
|
||||
avatarUrl?: string;
|
||||
bio?: string;
|
||||
clinic?: string;
|
||||
},
|
||||
) {
|
||||
return this.prisma.doctor.update({ where: { id }, data });
|
||||
}
|
||||
|
||||
|
||||
@@ -50,10 +50,18 @@ export class MediaController {
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Put(':id')
|
||||
@ApiOperation({ summary: 'ویرایش متادیتای سئوی فایل (Alt, Title, Description, Caption)' })
|
||||
@ApiOperation({
|
||||
summary: 'ویرایش متادیتای سئوی فایل (Alt, Title, Description, Caption)',
|
||||
})
|
||||
async updateMedia(
|
||||
@Param('id') id: string,
|
||||
@Body() body: { altText?: string; title?: string; description?: string; caption?: string },
|
||||
@Body()
|
||||
body: {
|
||||
altText?: string;
|
||||
title?: string;
|
||||
description?: string;
|
||||
caption?: string;
|
||||
},
|
||||
) {
|
||||
const data = await this.mediaService.updateMedia(id, body);
|
||||
return { success: true, data };
|
||||
|
||||
@@ -62,7 +62,15 @@ export class MediaService {
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
async updateMedia(id: string, data: { altText?: string; title?: string; description?: string; caption?: string }) {
|
||||
async updateMedia(
|
||||
id: string,
|
||||
data: {
|
||||
altText?: string;
|
||||
title?: string;
|
||||
description?: string;
|
||||
caption?: string;
|
||||
},
|
||||
) {
|
||||
return this.prisma.media.update({
|
||||
where: { id },
|
||||
data: {
|
||||
|
||||
Reference in new issue
Block a user