diff --git a/src/store/store.service.ts b/src/store/store.service.ts index 1a65e1d..3b9711c 100644 --- a/src/store/store.service.ts +++ b/src/store/store.service.ts @@ -140,7 +140,7 @@ export class StoreService { const user = await this.loadUserByToken(access_token); if (!user.is_admin && user.login !== searchStore.author) { - throw new UnauthorizedException('Доступ запрещен'); + throw new NotFoundException(`Not found api key "${omitProps.key}"`); } const store = { @@ -182,7 +182,7 @@ export class StoreService { if (user.is_admin || user.login === store.author || !store.hide) { return store; } - throw new UnauthorizedException('Доступ запрещен'); + throw new NotFoundException(`Not found api key "${key}"`); } async removeOne(api: string, key: string, access_token: string): Promise { @@ -192,7 +192,7 @@ export class StoreService { const user = await this.loadUserByToken(access_token); if (!user.is_admin && user.login !== searchStore.author) { - throw new UnauthorizedException('Доступ запрещен'); + throw new NotFoundException(`Not found api key "${key}"`); } await this.storeModel(api).deleteOne({key});