diff --git a/api/v1/resource.go b/api/v1/resource.go index d162b875..c4702cae 100644 --- a/api/v1/resource.go +++ b/api/v1/resource.go @@ -233,6 +233,7 @@ func (s *APIV1Service) UploadResource(c echo.Context) error { if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, "Failed to create resource").SetInternal(err) } + metric.Enqueue("resource create") return c.JSON(http.StatusOK, convertResourceFromStore(resource)) } diff --git a/api/v2/resource_service.go b/api/v2/resource_service.go index 8cf3dc5b..dd5a67d2 100644 --- a/api/v2/resource_service.go +++ b/api/v2/resource_service.go @@ -11,6 +11,7 @@ import ( "google.golang.org/protobuf/types/known/timestamppb" apiv2pb "github.com/usememos/memos/proto/gen/api/v2" + "github.com/usememos/memos/server/service/metric" "github.com/usememos/memos/store" ) @@ -44,6 +45,8 @@ func (s *APIV2Service) CreateResource(ctx context.Context, request *apiv2pb.Crea if err != nil { return nil, status.Errorf(codes.Internal, "failed to create resource: %v", err) } + + metric.Enqueue("resource create") return &apiv2pb.CreateResourceResponse{ Resource: s.convertResourceFromStore(ctx, resource), }, nil diff --git a/api/v2/tag_service.go b/api/v2/tag_service.go index f9922642..98ccaa8b 100644 --- a/api/v2/tag_service.go +++ b/api/v2/tag_service.go @@ -104,7 +104,7 @@ func (s *APIV2Service) RenameTag(ctx context.Context, request *apiv2pb.RenameTag return nil, status.Errorf(codes.Internal, "failed to parse memo: %v", err) } traverseASTNodes(nodes, func(node ast.Node) { - if tag, ok := node.(*ast.Tag); ok { + if tag, ok := node.(*ast.Tag); ok && tag.Content == request.OldName { tag.Content = request.NewName } }) diff --git a/web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx b/web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx index ac6618eb..224d7d09 100644 --- a/web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx +++ b/web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx @@ -38,8 +38,8 @@ const EmbeddedMemo = ({ resourceId, params: paramsStr }: Props) => { // Add the memo to the set of embedded memos. This is used to prevent infinite loops when a memo embeds itself. context.embeddedMemos.add(resourceName); const params = new URLSearchParams(paramsStr); - const useInlineMode = params.has("inline"); - if (useInlineMode) { + const inlineMode = params.has("inline"); + if (inlineMode) { return (