UNPKG

@ministryofjustice/hmpps-digital-prison-reporting-frontend

Version:

The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.

3 lines (2 loc) 1.04 kB
var i=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var s in e)i(t,s,{get:e[s],enumerable:!0})},g=(t,e,s,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of m(e))!R.call(t,r)&&r!==s&&i(t,r,{get:()=>e[r],enumerable:!(a=h(e,r))||a.enumerable});return t};var w=t=>g(i({},"__esModule",{value:!0}),t);var v={};d(v,{getDuplicateRequestIds:()=>n,removeDuplicates:()=>y});module.exports=w(v);var y=async({storeService:t,userId:e,id:s,search:a})=>{let r=await t.getAllReportsById(s,e),o=n(a,r);o.length&&await Promise.all(o.map(async c=>{await await t.removeReport(c,e)}))},n=(t,e)=>{let s=[],a=new URLSearchParams(t);return e.forEach(r=>{let o=[],c=new URLSearchParams(r.url.request.search);c.entries.length===a.entries.length&&a.forEach((p,l)=>{let u=c.has(l,p);o.push(u)}),o.every(Boolean)&&s.push(r.executionId)}),s};0&&(module.exports={getDuplicateRequestIds,removeDuplicates}); //# sourceMappingURL=reportStoreHelper.js.map