Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
1 line
1.9 KiB
Plaintext
1 line
1.9 KiB
Plaintext
{"version":3,"sources":["../../../src/collections/endpoints/restoreVersion.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\n\nimport type { PayloadHandler } from '../../config/types.js'\n\nimport { getRequestCollectionWithID } from '../../utilities/getRequestEntity.js'\nimport { headersWithCors } from '../../utilities/headersWithCors.js'\nimport { parseParams } from '../../utilities/parseParams/index.js'\nimport { restoreVersionOperation } from '../operations/restoreVersion.js'\n\nexport const restoreVersionHandler: PayloadHandler = async (req) => {\n const { id, collection } = getRequestCollectionWithID(req)\n\n const { depth, draft, populate } = parseParams(req.query)\n\n const result = await restoreVersionOperation({\n id,\n collection,\n depth,\n draft,\n populate,\n req,\n })\n\n return Response.json(\n {\n ...result,\n message: req.t('version:restoredSuccessfully'),\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["status","httpStatus","getRequestCollectionWithID","headersWithCors","parseParams","restoreVersionOperation","restoreVersionHandler","req","id","collection","depth","draft","populate","query","result","Response","json","message","t","headers","Headers","OK"],"mappings":"AAAA,SAASA,UAAUC,UAAU,QAAQ,cAAa;AAIlD,SAASC,0BAA0B,QAAQ,sCAAqC;AAChF,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,WAAW,QAAQ,uCAAsC;AAClE,SAASC,uBAAuB,QAAQ,kCAAiC;AAEzE,OAAO,MAAMC,wBAAwC,OAAOC;IAC1D,MAAM,EAAEC,EAAE,EAAEC,UAAU,EAAE,GAAGP,2BAA2BK;IAEtD,MAAM,EAAEG,KAAK,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGR,YAAYG,IAAIM,KAAK;IAExD,MAAMC,SAAS,MAAMT,wBAAwB;QAC3CG;QACAC;QACAC;QACAC;QACAC;QACAL;IACF;IAEA,OAAOQ,SAASC,IAAI,CAClB;QACE,GAAGF,MAAM;QACTG,SAASV,IAAIW,CAAC,CAAC;IACjB,GACA;QACEC,SAAShB,gBAAgB;YACvBgB,SAAS,IAAIC;YACbb;QACF;QACAP,QAAQC,WAAWoB,EAAE;IACvB;AAEJ,EAAC"} |