forked from Yara724/api
fanavaran V15 tejaratno
This commit is contained in:
@@ -34,6 +34,13 @@ export class FanavaranLookupService {
|
||||
private readonly lookupModel: Model<LookupDocument>,
|
||||
) {}
|
||||
|
||||
/** Stored `lookups` collection row. Does not call Fanavaran. */
|
||||
async readStoredLookup(name: string): Promise<unknown | null> {
|
||||
const doc = await this.lookupModel.findOne({ name }).lean().exec();
|
||||
if (!doc) return null;
|
||||
return (doc as { response?: unknown }).response ?? null;
|
||||
}
|
||||
|
||||
private cacheFilePath(clientKey: FanavaranClientKey, fileName: string): string {
|
||||
return join(fanavaranLookupCacheDir(clientKey), fileName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user