All files / src/components/chat/auto-approve-menu AutoApproveSettingsAPI.ts

0% Statements 0/11
100% Branches 1/1
100% Functions 1/1
0% Lines 0/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17                                 
import { AutoApprovalSettings } from "@shared/AutoApprovalSettings"
import { StateServiceClient } from "@/services/grpc-client"
 
/**
 * Updates auto approval settings using the gRPC/Protobus client
 * @param settings The auto approval settings to update
 * @throws Error if the update fails
 */
export async function updateAutoApproveSettings(settings: AutoApprovalSettings) {
	try {
		await StateServiceClient.updateAutoApprovalSettings({ metadata: {}, ...settings })
	} catch (error) {
		console.error("Failed to update auto approval settings:", error)
		throw error
	}
}