This commit is contained in:
@@ -43,7 +43,7 @@ export async function findPublishedVehicles(where: any) {
|
||||
|
||||
export async function findVehicleForCarplace(vehicleId: string, companySlug: string) {
|
||||
return prisma.vehicle.findFirst({
|
||||
where: { id: vehicleId, isPublished: true, company: { status: { in: ['ACTIVE', 'TRIALING'] }, OR: [{ slug: companySlug }, { brand: { subdomain: companySlug } }] } },
|
||||
where: { id: vehicleId, isPublished: true, status: 'AVAILABLE', company: { status: { in: ['ACTIVE', 'TRIALING'] }, OR: [{ slug: companySlug }, { brand: { subdomain: companySlug } }] } },
|
||||
include: { company: { include: { brand: true } } },
|
||||
})
|
||||
}
|
||||
@@ -53,6 +53,7 @@ export async function findVehicleForCarplaceById(vehicleId: string) {
|
||||
where: {
|
||||
id: vehicleId,
|
||||
isPublished: true,
|
||||
status: 'AVAILABLE',
|
||||
company: { status: { in: ['ACTIVE', 'TRIALING'] }, brand: { isListedOnCarplace: true } },
|
||||
},
|
||||
include: { company: { include: { brand: true } } },
|
||||
@@ -139,6 +140,7 @@ export async function createCarplaceFunnelEvent(data: {
|
||||
id: data.vehicleId,
|
||||
isPublished: true,
|
||||
company: { status: { in: ['ACTIVE', 'TRIALING'] }, OR: [{ slug: data.companySlug }, { brand: { subdomain: data.companySlug } }] },
|
||||
status: 'AVAILABLE',
|
||||
},
|
||||
select: { companyId: true },
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user