fixed the stepper endpoint
This commit is contained in:
@@ -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.');
|
||||
|
||||
Reference in New Issue
Block a user