make api routes kebab

This commit is contained in:
LenAnderson 2023-11-20 18:27:50 +00:00
parent 8b5a56a99c
commit 3d4442ab25
2 changed files with 5 additions and 5 deletions

View File

@ -2115,7 +2115,7 @@ async function onComfyOpenWorkflowEditorClick() {
checkPlaceholders(); checkPlaceholders();
$('#sd_comfy_workflow_editor_workflow').on('input', checkPlaceholders); $('#sd_comfy_workflow_editor_workflow').on('input', checkPlaceholders);
if (await popupResult) { if (await popupResult) {
const response = await fetch(`/api/sd/comfy/saveWorkflow`, { const response = await fetch(`/api/sd/comfy/save-workflow`, {
method: 'POST', method: 'POST',
headers: getRequestHeaders(), headers: getRequestHeaders(),
body: JSON.stringify({ body: JSON.stringify({
@ -2139,7 +2139,7 @@ async function onComfyNewWorkflowClick() {
name += '.json'; name += '.json';
} }
extension_settings.sd.comfy_workflow = name; extension_settings.sd.comfy_workflow = name;
const response = await fetch(`/api/sd/comfy/saveWorkflow`, { const response = await fetch(`/api/sd/comfy/save-workflow`, {
method: 'POST', method: 'POST',
headers: getRequestHeaders(), headers: getRequestHeaders(),
body: JSON.stringify({ body: JSON.stringify({
@ -2162,7 +2162,7 @@ async function onComfyDeleteWorkflowClick() {
if (!confirm) { if (!confirm) {
return; return;
} }
const response = await fetch('/api/sd/comfy/deleteWorkflow', { const response = await fetch('/api/sd/comfy/delete-workflow', {
method: 'POST', method: 'POST',
headers: getRequestHeaders(), headers: getRequestHeaders(),
body: JSON.stringify({ body: JSON.stringify({

View File

@ -474,7 +474,7 @@ function registerEndpoints(app, jsonParser) {
} }
}); });
app.post('/api/sd/comfy/saveWorkflow', jsonParser, async (request, response) => { app.post('/api/sd/comfy/save-workflow', jsonParser, async (request, response) => {
try { try {
writeFileAtomicSync( writeFileAtomicSync(
`${DIRECTORIES.comfyWorkflows}/${sanitize(String(request.body.file_name))}`, `${DIRECTORIES.comfyWorkflows}/${sanitize(String(request.body.file_name))}`,
@ -489,7 +489,7 @@ function registerEndpoints(app, jsonParser) {
} }
}); });
app.post('/api/sd/comfy/deleteWorkflow', jsonParser, async (request, response) => { app.post('/api/sd/comfy/delete-workflow', jsonParser, async (request, response) => {
try { try {
let path = `${DIRECTORIES.comfyWorkflows}/${sanitize(String(request.body.file_name))}`; let path = `${DIRECTORIES.comfyWorkflows}/${sanitize(String(request.body.file_name))}`;
if (fs.existsSync(path)) { if (fs.existsSync(path)) {