tambahan
This commit is contained in:
@@ -64,9 +64,9 @@ function FlowWaHookList() {
|
|||||||
setLoading(false);
|
setLoading(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const setAsDefault = async (id: string) => {
|
const setAsDefault = async (id: string, defaultData: any) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const { error } = await apiFetch.api.chatflows.default.put({ id, defaultData: {} });
|
const { error } = await apiFetch.api.chatflows.default.put({ id, defaultData });
|
||||||
if (error) {
|
if (error) {
|
||||||
showNotification({ title: "Error", message: "Failed to set default flow", color: "red" });
|
showNotification({ title: "Error", message: "Failed to set default flow", color: "red" });
|
||||||
} else {
|
} else {
|
||||||
@@ -99,7 +99,7 @@ function FlowWaHookList() {
|
|||||||
<Table.Td>{flow.name}</Table.Td>
|
<Table.Td>{flow.name}</Table.Td>
|
||||||
<Table.Td>{flow.type}</Table.Td>
|
<Table.Td>{flow.type}</Table.Td>
|
||||||
<Table.Td>
|
<Table.Td>
|
||||||
<Checkbox checked={defaultFlow === flow.id} onChange={() => setAsDefault(flow.id)} />
|
<Checkbox checked={defaultFlow === flow.id} onChange={() => setAsDefault(flow.id, flow)} />
|
||||||
</Table.Td>
|
</Table.Td>
|
||||||
</Table.Tr>
|
</Table.Tr>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ const FlowRoute = new Elysia({
|
|||||||
{
|
{
|
||||||
body: t.Object({
|
body: t.Object({
|
||||||
id: t.String(),
|
id: t.String(),
|
||||||
defaultData: t.Optional(t.Any()),
|
defaultData: t.Any(),
|
||||||
}),
|
}),
|
||||||
detail: {
|
detail: {
|
||||||
summary: "Update default chatflows",
|
summary: "Update default chatflows",
|
||||||
|
|||||||
Reference in New Issue
Block a user