Browse Source

remove type ITagNames

kaori 3 years ago
parent
commit
5ba8e370c1

+ 1 - 3
packages/app/src/client/util/editor.ts

@@ -1,5 +1,3 @@
-import { ITagNames } from '~/interfaces/tag';
-
 type OptionsToSave = {
   isSlackEnabled: boolean;
   slackChannels: string;
@@ -16,7 +14,7 @@ export const getOptionsToSave = (
     grant: number,
     grantUserGroupId: string | null | undefined,
     grantUserGroupName: string | null | undefined,
-    pageTags: ITagNames,
+    pageTags: string[],
 ): OptionsToSave => {
   return {
     pageTags,

+ 4 - 5
packages/app/src/interfaces/tag.ts

@@ -5,23 +5,22 @@ export type ITag<ID = string> = {
 
 export type IDataTagCount = ITag & {count: number}
 
-export type ITagNames = ITag['name'][]
 
 export type IPageTagsInfo = {
-  tags : ITagNames,
+  tags : string[],
 }
 
-export type IListTagNamesByPage = ITagNames
+export type IListTagNamesByPage = string[];
 
 
 export type IResTagsSearchApiv1 = {
   ok: boolean,
-  tags: ITagNames
+  tags: string[]
 }
 
 export type IResGetPageTags = {
   ok: boolean,
-  tags: ITagNames,
+  tags: string[],
 };
 
 export type IResTagsListApiv1 = {

+ 2 - 3
packages/app/src/stores/editor.tsx

@@ -5,7 +5,6 @@ import { apiGet } from '~/client/util/apiv1-client';
 import { apiv3Get, apiv3Put } from '~/client/util/apiv3-client';
 import { Nullable } from '~/interfaces/common';
 import { IEditorSettings } from '~/interfaces/editor-settings';
-import { ITagNames } from '~/interfaces/tag';
 import { SlackChannels } from '~/interfaces/user-trigger-notification';
 
 import {
@@ -92,6 +91,6 @@ export const useIsSlackEnabled = (): SWRResponse<boolean, Error> => {
   );
 };
 
-export const useStaticPageTags = (initialTags?: ITagNames): SWRResponse<ITagNames, Error> => {
-  return useStaticSWR<ITagNames, Error>('pageTags', undefined, { fallbackData: initialTags || [] });
+export const useStaticPageTags = (initialTags?: string[]): SWRResponse<string[], Error> => {
+  return useStaticSWR<string[], Error>('pageTags', undefined, { fallbackData: initialTags || [] });
 };