remove rule files conversion and directly create grpc request (#5914)
This commit is contained in:
1 parent
d462e0b67c
commit
c4d576d830
3 files changed
+6
-31
No files matched your search
@@ -1,25 +0,0 @@
|
||||
import { RuleFileRequest } from "@shared/proto/cline/file"
|
||||
|
||||
// Helper for creating delete requests
|
||||
export const DeleteRuleFileRequest = {
|
||||
create: (params: { rulePath: string; isGlobal: boolean; metadata?: any; type?: string }): RuleFileRequest => {
|
||||
return RuleFileRequest.create({
|
||||
rulePath: params.rulePath,
|
||||
isGlobal: params.isGlobal,
|
||||
metadata: params.metadata,
|
||||
type: params.type,
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
// Helper for creating create requests
|
||||
export const CreateRuleFileRequest = {
|
||||
create: (params: { filename: string; isGlobal: boolean; metadata?: any; type?: string }): RuleFileRequest => {
|
||||
return RuleFileRequest.create({
|
||||
filename: params.filename,
|
||||
isGlobal: params.isGlobal,
|
||||
metadata: params.metadata,
|
||||
type: params.type,
|
||||
})
|
||||
},
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CreateRuleFileRequest } from "@shared/proto-conversions/file/rule-files-conversion"
|
||||
import { RuleFileRequest } from "@shared/proto/index.cline"
|
||||
import { VSCodeButton } from "@vscode/webview-ui-toolkit/react"
|
||||
import { useEffect, useRef, useState } from "react"
|
||||
import { useClickAway } from "react-use"
|
||||
@@ -63,7 +63,7 @@ const NewRuleRow: React.FC<NewRuleRowProps> = ({ isGlobal, ruleType }) => {
|
||||
|
||||
try {
|
||||
await FileServiceClient.createRuleFile(
|
||||
CreateRuleFileRequest.create({
|
||||
RuleFileRequest.create({
|
||||
isGlobal,
|
||||
filename: finalFilename,
|
||||
type: ruleType || "cline",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { StringRequest } from "@shared/proto/cline/common"
|
||||
import { DeleteRuleFileRequest } from "@shared/proto-conversions/file/rule-files-conversion"
|
||||
import { RuleFileRequest } from "@shared/proto/index.cline"
|
||||
import { VSCodeButton } from "@vscode/webview-ui-toolkit/react"
|
||||
import { FileServiceClient } from "@/services/grpc-client"
|
||||
|
||||
@@ -64,9 +64,9 @@ const RuleRow: React.FC<{
|
||||
|
||||
const handleDeleteClick = () => {
|
||||
FileServiceClient.deleteRuleFile(
|
||||
DeleteRuleFileRequest.create({
|
||||
rulePath: rulePath,
|
||||
isGlobal: isGlobal,
|
||||
RuleFileRequest.create({
|
||||
rulePath,
|
||||
isGlobal,
|
||||
type: ruleType || "cline",
|
||||
}),
|
||||
).catch((err) => console.error("Failed to delete rule file:", err))
|
||||
|
||||
Reference in new issue
Block a user