Skip to content

Commit e23440c

Browse files
kelvinsbHelioDantas
authored andcommitted
feat: return contact when user logged, instead of some Roles
1 parent e2c6242 commit e23440c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/shelter/shelter.service.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { z } from 'zod';
22
import { Injectable } from '@nestjs/common';
33
import * as qs from 'qs';
4-
import { Prisma, AccessLevel } from '@prisma/client';
4+
import { Prisma } from '@prisma/client';
55
import { DefaultArgs } from '@prisma/client/runtime/library';
66

77
import { PrismaService } from '../prisma/prisma.service';
@@ -14,7 +14,6 @@ import { SearchSchema } from '../types';
1414
import { ShelterSearch, parseTagResponse } from './ShelterSearch';
1515
import { SupplyPriority } from '../supply/types';
1616
import { IFilterFormProps } from './types/search.types';
17-
import { isRightSessionRole } from '@/guards/utils';
1817

1918
@Injectable()
2019
export class ShelterService {
@@ -62,11 +61,8 @@ export class ShelterService {
6261
}
6362

6463
async show(id: string, user: any) {
65-
const isLogged = await isRightSessionRole(
66-
[AccessLevel.User, AccessLevel.Staff],
67-
user?.sessionId,
68-
user?.userId,
69-
);
64+
const isLogged =
65+
Boolean(user) && Boolean(user?.sessionId) && Boolean(user?.userId);
7066

7167
const data = await this.prismaService.shelter.findFirst({
7268
where: {

0 commit comments

Comments
 (0)