From 133951328bd16a48a73768274c8008da15a3e57b Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 12 Apr 2024 08:36:02 +0800 Subject: [PATCH] chore: fix linter --- .../route/api/v2/workspace_setting_service.go | 2 +- .../components/ExploreSidebar/TagsSection.tsx | 38 ------------------- .../components/HomeSidebar/TagsSection.tsx | 4 +- 3 files changed, 2 insertions(+), 42 deletions(-) delete mode 100644 web/src/components/ExploreSidebar/TagsSection.tsx diff --git a/server/route/api/v2/workspace_setting_service.go b/server/route/api/v2/workspace_setting_service.go index d8aeb7d3..7dd76e1c 100644 --- a/server/route/api/v2/workspace_setting_service.go +++ b/server/route/api/v2/workspace_setting_service.go @@ -12,7 +12,7 @@ import ( "github.com/usememos/memos/store" ) -func (s *APIV2Service) ListWorkspaceSettings(ctx context.Context, request *apiv2pb.ListWorkspaceSettingsRequest) (*apiv2pb.ListWorkspaceSettingsResponse, error) { +func (s *APIV2Service) ListWorkspaceSettings(ctx context.Context, _ *apiv2pb.ListWorkspaceSettingsRequest) (*apiv2pb.ListWorkspaceSettingsResponse, error) { workspaceSettings, err := s.Store.ListWorkspaceSettingsV1(ctx, &store.FindWorkspaceSetting{}) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get workspace setting: %v", err) diff --git a/web/src/components/ExploreSidebar/TagsSection.tsx b/web/src/components/ExploreSidebar/TagsSection.tsx deleted file mode 100644 index 280596c4..00000000 --- a/web/src/components/ExploreSidebar/TagsSection.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { useEffect, useState } from "react"; -import { tagServiceClient } from "@/grpcweb"; -import { Tag } from "@/types/proto/api/v2/tag_service"; -import Icon from "../Icon"; - -const TagsSection = () => { - const [tags, setTags] = useState([]); - - useEffect(() => { - (async () => { - const { tags } = await tagServiceClient.listTags({}); - setTags(tags); - })(); - }, []); - - return ( - tags.length > 0 && ( -
-
- Tags -
-
- {tags.map((tag) => ( -
- - {tag.name} -
- ))} -
-
- ) - ); -}; - -export default TagsSection; diff --git a/web/src/components/HomeSidebar/TagsSection.tsx b/web/src/components/HomeSidebar/TagsSection.tsx index c52eace0..07dfc439 100644 --- a/web/src/components/HomeSidebar/TagsSection.tsx +++ b/web/src/components/HomeSidebar/TagsSection.tsx @@ -92,9 +92,7 @@ const TagsSection = () => { ) : (
-

- {t("tag.create-tags-guide")} -

+

{t("tag.create-tags-guide")}

)}