diff --git a/admin/src/hooks/useContentManager.ts b/admin/src/hooks/useContentManager.ts index 4024995..bbbecc5 100644 --- a/admin/src/hooks/useContentManager.ts +++ b/admin/src/hooks/useContentManager.ts @@ -4,7 +4,7 @@ import { UID } from "@strapi/strapi"; import { fetchReactions } from "../injections/utils/api"; import { StrapiId } from "../../../types"; -export type ContentManagerType = 'singleType' | 'collectionType'; +export type ContentManagerType = 'single-types' | 'collection-types'; const useContentManager = (uid: UID.ContentType, id: StrapiId) => { const fetch = useQuery("get-reactions", () => fetchReactions(uid, id)); diff --git a/admin/src/injections/EditViewSummary/index.tsx b/admin/src/injections/EditViewSummary/index.tsx index 56d8ef4..bafb68c 100644 --- a/admin/src/injections/EditViewSummary/index.tsx +++ b/admin/src/injections/EditViewSummary/index.tsx @@ -17,10 +17,10 @@ import { ReactionCounter, ReactionCounterProps } from "./components/ReactionCoun import useContentManager, { ContentManagerType } from "../../hooks/useContentManager"; import useConfig from "../../hooks/useConfig"; -const CONTENT_MANAGER_PATH_PATTERN = /.*\/(?[a-zA-Z]+)\/(?[a-z0-9-_]+::[a-z0-9-_]+\.[a-z0-9-_]+)\/?(?\d*)/; +const CONTENT_MANAGER_PATH_PATTERN = /.*\/(?[a-zA-Z-]+)\/(?[a-z0-9-_]+::[a-z0-9-_]+\.[a-z0-9-_]+)\/?(?\d*)/; const CONTENT_MANAGER_TYPES: { [key: string]: ContentManagerType } = { - SINGLE_TYPE: 'singleType', - COLLECTION_TYPE: 'collectionType', + SINGLE_TYPE: 'single-types', + COLLECTION_TYPE: 'collection-types', }; type ContentManagerPathProps = { @@ -35,7 +35,7 @@ export const EditViewSummary = () => { const groups: ContentManagerPathProps = new RegExp(CONTENT_MANAGER_PATH_PATTERN, "gm") .exec(location.pathname)?.groups as ContentManagerPathProps; - console.log(groups); + const { uid, id, type } = groups; if (!id && (type === CONTENT_MANAGER_TYPES.COLLECTION_TYPE)) { diff --git a/package.json b/package.json index 7d1b863..97bcf0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-reactions", - "version": "1.1.8", + "version": "1.1.9", "description": "Strapi - Reactions plugin", "strapi": { "name": "reactions",