UNPKG

payload

Version:

Node, React, Headless CMS and Application Framework built on Next.js

22 lines (21 loc) 898 B
// @ts-strict-ignore /* eslint-disable no-restricted-exports */ import { APIError } from '../../../errors/index.js'; import { createLocalReq } from '../../../utilities/createLocalReq.js'; import { restoreVersionOperation } from '../restoreVersion.js'; export default async function restoreVersionLocal(payload, options) { const { id, slug: globalSlug, depth, overrideAccess = true, populate, showHiddenFields } = options; const globalConfig = payload.globals.config.find((config)=>config.slug === globalSlug); if (!globalConfig) { throw new APIError(`The global with slug ${String(globalSlug)} can't be found.`); } return restoreVersionOperation({ id, depth, globalConfig, overrideAccess, populate, req: await createLocalReq(options, payload), showHiddenFields }); } //# sourceMappingURL=restoreVersion.js.map