HOT-FIX POST

This commit is contained in:
vigdorov
2020-08-02 22:55:18 +03:00
parent 1159b6321f
commit 5919ba92f1

View File

@ -31,7 +31,7 @@ export class StoreService {
} }
async create(api: string, store: StoreRequest): Promise<Store> { async create(api: string, store: StoreRequest): Promise<Store> {
const searchStore = await this.findOne(api, store.key); const searchStore = await this.storeModel(api).findOne({key: store.key});
if (searchStore) { if (searchStore) {
throw new ConflictException(`Api key "${store.key}" is already taken`); throw new ConflictException(`Api key "${store.key}" is already taken`);