fixed the stepper endpoint

This commit is contained in:
2025-11-14 15:15:13 +05:30
parent 03c2e729a0
commit 8c48db854e
4 changed files with 52 additions and 129 deletions

View File

@@ -50,36 +50,6 @@ export class MinglarService {
return this.prisma.user.findMany({ where: { roleXid: 3 } });
}
async getHostById(id: number) {
const host = await this.prisma.user.findUnique({
where: { id },
include: {
HostHeader: {
include: {
currencies: true,
cities: true,
states: true,
countries: true,
HostBankDetails: true,
HostDocuments: true,
HostSuggestion: true,
hostParent: true,
HostTrack: true,
Activities: true,
},
},
UserOtp: true,
Token: true,
},
});
if (!host || host.roleXid !== 4) {
throw new ApiError(404, 'Host not found');
}
return host;
}
async updateHost(id: number, data: UpdateMinglarDto) {
return this.prisma.user.update({
where: { id },
@@ -149,6 +119,7 @@ export class MinglarService {
if (!existingUser) {
throw new ApiError(404, 'User not found');
}
console.log(existingUser.roleXid);
if (existingUser.roleXid !== ROLE.MINGLAR_ADMIN || existingUser.roleXid !== ROLE.CO_ADMIN || existingUser.roleXid !== ROLE.ACCOUNT_MANAGER) {
throw new ApiError(403, 'Access denied.');