{"version":3,"file":"homepage.mjs","sources":["../../../../server/src/homepage/services/homepage.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nimport type { GetRecentlyAssignedDocuments } from '../../../../shared/contracts/homepage';\n\nconst createHomepageService = ({ strapi }: { strapi: Core.Strapi }) => {\n  return {\n    async getRecentlyAssignedDocuments(): Promise<GetRecentlyAssignedDocuments.Response['data']> {\n      const userId = strapi.requestContext.get()?.state?.user.id;\n      const { queryLastDocuments, addStatusToDocuments } = strapi\n        .plugin('content-manager')\n        .service('homepage');\n\n      const recentlyAssignedDocuments = await queryLastDocuments({\n        populate: ['strapi_stage'],\n        filters: {\n          strapi_assignee: {\n            id: userId,\n          },\n        },\n      });\n\n      return addStatusToDocuments(recentlyAssignedDocuments);\n    },\n  };\n};\n\nexport { createHomepageService };\n"],"names":["createHomepageService","strapi","getRecentlyAssignedDocuments","userId","requestContext","get","state","user","id","queryLastDocuments","addStatusToDocuments","plugin","service","recentlyAssignedDocuments","populate","filters","strapi_assignee"],"mappings":"AAIA,MAAMA,qBAAAA,GAAwB,CAAC,EAAEC,MAAM,EAA2B,GAAA;IAChE,OAAO;QACL,MAAMC,4BAAAA,CAAAA,GAAAA;AACJ,YAAA,MAAMC,SAASF,MAAAA,CAAOG,cAAc,CAACC,GAAG,EAAA,EAAIC,OAAOC,IAAAA,CAAKC,EAAAA;YACxD,MAAM,EAAEC,kBAAkB,EAAEC,oBAAoB,EAAE,GAAGT,MAAAA,CAClDU,MAAM,CAAC,iBAAA,CAAA,CACPC,OAAO,CAAC,UAAA,CAAA;YAEX,MAAMC,yBAAAA,GAA4B,MAAMJ,kBAAAA,CAAmB;gBACzDK,QAAAA,EAAU;AAAC,oBAAA;AAAe,iBAAA;gBAC1BC,OAAAA,EAAS;oBACPC,eAAAA,EAAiB;wBACfR,EAAAA,EAAIL;AACN;AACF;AACF,aAAA,CAAA;AAEA,YAAA,OAAOO,oBAAAA,CAAqBG,yBAAAA,CAAAA;AAC9B,QAAA;AACF,KAAA;AACF;;;;"}