refactor: single cache.del call

This commit is contained in:
Barış Soner Uşaklı
2024-06-04 21:14:11 -04:00
parent 709c91329a
commit 9868a728bf

View File

@@ -72,9 +72,7 @@ module.exports = function (Posts) {
Posts.clearCachedPost = function (pid) {
const cache = require('./cache');
allowedTypes.forEach((type) => {
cache.del(`${String(pid)}|${type}`);
});
cache.del(allowedTypes.map(type => `${String(pid)}|${type}`));
};
Posts.parseSignature = async function (userData, uid) {