|
|
@@ -1,8 +1,13 @@
|
|
|
import {drugsSearchForMechanism, drugsSearchForSystem} from "@/api/drugs/drugs";
|
|
|
|
|
|
+let drugsSearchForSystemCache = new Map();
|
|
|
+
|
|
|
export default {
|
|
|
'drugsSearchForSystem': (query) => {
|
|
|
- return drugsSearchForSystem({name: query.name || ''})
|
|
|
+ const name = query.name || '';
|
|
|
+ if (drugsSearchForSystemCache.size > 100) drugsSearchForSystemCache.clear();
|
|
|
+ if (!drugsSearchForSystemCache.has(name)) drugsSearchForSystemCache.set(name, drugsSearchForSystem({name}));
|
|
|
+ return drugsSearchForSystemCache.get(name);
|
|
|
},
|
|
|
'drugsSearchForMechanism': (query) => {
|
|
|
return drugsSearchForMechanism({
|