This commit is contained in:
2026-02-27 19:03:28 +05:30
parent 5d879542a1
commit 9d64759097

View File

@@ -2620,14 +2620,14 @@ export class HostService {
return await this.prisma.$transaction(async (tx) => {
const hostUserDetail = await tx.user.findFirst({
where: { id: userId, isActive: true},
where: { id: userId, isActive: true },
select: {
id: true,
userRefNumber: true,
}
})
if(!hostUserDetail) {
if (!hostUserDetail) {
throw new ApiError(404, 'User not found');
}
const host = await tx.hostHeader.findFirst({
@@ -2636,11 +2636,11 @@ export class HostService {
if (!host) throw new ApiError(404, 'Host not found for the user');
const activityType = await tx.activityTypes.findUnique({
where: { id: activityTypeXid },
where: { id: activityTypeXid, isActive: true },
include: {
interests: true, // ✅ correct
energyLevel: true, // ✅ this is correct already
},
interests: true, // ✅ correct
energyLevel: true, // ✅ this is correct already
},
});
if (!activityType) throw new ApiError(404, 'Activity type not found');