HOT-FIX. Коррекция ошибок
This commit is contained in:
@ -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<Store> {
|
||||
@ -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});
|
||||
|
||||
Reference in New Issue
Block a user