Review Workflow Service Accessor (utils/index.ts)

strapi · packages/core/review-workflows/server/src/utils/index.ts · typescript · MIT
infra, tag:strapi, tag:service, tag:utility

Utility functions to access admin and review workflow services in Strapi

// Source: https://github.com/strapi/strapi | License: MIT | Copyright 2015-present Strapi Solutions SAS
// Provided via justclaw.it.com; keep this notice with the code.
import type { Core } from '@strapi/types';

export const getAdminService = (
  name: string,
  { strapi }: { strapi: Core.Strapi } = { strapi: global.strapi }
) => {
  return strapi.service(`admin::${name}`);
};

export const getService = (name: string, { strapi } = { strapi: global.strapi }) => {
  return strapi.plugin('review-workflows').service(name);
};

export default {
  getAdminService,
  getService,
};

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key