add: template editor

This commit is contained in:
h z
2025-04-14 17:02:22 +01:00
parent 09338a2683
commit 947b59e3ea
29 changed files with 1277 additions and 166 deletions

View File

@@ -4,14 +4,14 @@ import {
useCreateWebhookSetting,
useUpdateWebhookSetting,
useWebhooks,
} from "../../../utils/webhook-queries";
} from "../../../utils/queries/webhook-queries";
import {
useCreateWebhook,
useUpdateWebhook,
useDeleteWebhook,
} from "../../../utils/webhook-queries";
import {useUpdatePathSetting} from "../../../utils/setting-queries";
} from "../../../utils/queries/webhook-queries";
import {useUpdatePathSetting} from "../../../utils/queries/setting-queries";
const WebhookSettingPanel = ({pathSetting, onClose}) => {
@@ -89,7 +89,12 @@ const WebhookSettingPanel = ({pathSetting, onClose}) => {
const handleCreateWebhookSetting = () => {
createWebhookSetting.mutate({}, {
onSuccess: (data) => {
updatePathSetting.mutate({id: pathSetting.id, data: {webhook_setting_id: data.id}});
updatePathSetting.mutate({
id: pathSetting.id,
data: {
webhook_setting_id: data.id
}
});
}
});
};
@@ -115,9 +120,6 @@ const WebhookSettingPanel = ({pathSetting, onClose}) => {
}
const found = webhooks.find((wh) => wh.id === setting.webhook_id);
console.log("found", found);
console.log("webhooks", webhooks);
console.log("setting.webhook_id", setting.webhook_id);
setSelectedUrl(found ? found.hook_url : "");
} else {
setEnabled(false);
@@ -191,8 +193,6 @@ const WebhookSettingPanel = ({pathSetting, onClose}) => {
on_events: onEvents,
};
console.log(webhooks);
console.log(payload);
if(!setting || !setting.id){
createWebhookSetting.mutate(payload, {
onSuccess: (res) => {