forked from Yara724/api
fanavaran V15 tejaratno
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { tejaratNotifierLookup } from "src/fanavaran/tejarat-notifier";
|
||||
import { isTejaratNotifierLookup } from "src/fanavaran/tejarat-notifier";
|
||||
import {
|
||||
BadRequestException,
|
||||
Injectable,
|
||||
@@ -126,12 +126,15 @@ export class LookupsService implements OnModuleInit, OnModuleDestroy {
|
||||
|
||||
async getClientRemoteLookup(lookupName: string): Promise<unknown> {
|
||||
const clientKey = this.activeClientKey();
|
||||
const notifier = tejaratNotifierLookup(lookupName);
|
||||
if (notifier) {
|
||||
if (isTejaratNotifierLookup(lookupName)) {
|
||||
if (clientKey !== "tejaratno") {
|
||||
throw new BadRequestException("Notifier lookups apply only to TejaratNo.");
|
||||
}
|
||||
return notifier;
|
||||
const stored = await this.fanavaranLookupService.readStoredLookup(lookupName);
|
||||
if (stored == null) {
|
||||
throw new NotFoundException(`Lookup "${lookupName}" not found`);
|
||||
}
|
||||
return stored;
|
||||
}
|
||||
const definition = this.findRemoteLookup(lookupName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user