fix: 修复前端编译 TS 错误
- App 类型补充 is_favorited?: boolean 字段 - platform/providers 页面 testConnection mutationFn 补充泛型参数
This commit is contained in:
@@ -157,7 +157,7 @@ export default function AppDetailPage() {
|
||||
|
||||
const CategoryIcon = getCategoryIcon(app.category_slug);
|
||||
const categoryColor = getCategoryColor(app.category_slug);
|
||||
const isFavorited = (app as any).is_favorited;
|
||||
const isFavorited = app.is_favorited;
|
||||
const typeConfig = getAppTypeConfig(app.dify_app_type);
|
||||
const TypeIcon = typeConfig.icon;
|
||||
|
||||
|
||||
@@ -128,8 +128,11 @@ export default function PlatformProvidersPage() {
|
||||
});
|
||||
|
||||
const testConnection = useMutation({
|
||||
mutationFn: (id: string) => api.post(`/api/v1/platform/providers/${id}/test`),
|
||||
onSuccess: (data: any) => {
|
||||
mutationFn: (id: string) =>
|
||||
api.post<{ success: boolean; message?: string; response?: string }>(
|
||||
`/api/v1/platform/providers/${id}/test`
|
||||
),
|
||||
onSuccess: (data) => {
|
||||
if (data.success) {
|
||||
toast.success("连接测试成功", {
|
||||
description: data.response || "Provider 响应正常",
|
||||
|
||||
@@ -20,6 +20,7 @@ export interface App {
|
||||
visibility: "private" | "department" | "public";
|
||||
is_featured: boolean;
|
||||
is_template: boolean;
|
||||
is_favorited?: boolean;
|
||||
usage_count: number;
|
||||
favorite_count: number;
|
||||
avg_rating: number;
|
||||
|
||||
Reference in New Issue
Block a user