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();
$('#sd_comfy_workflow_editor_workflow').on('input', checkPlaceholders);
if (await popupResult) {
const response = await fetch(`/api/sd/comfy/saveWorkflow`, {
const response = await fetch(`/api/sd/comfy/save-workflow`, {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify({
@ -2139,7 +2139,7 @@ async function onComfyNewWorkflowClick() {
name += '.json';
}
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',
headers: getRequestHeaders(),
body: JSON.stringify({
@ -2162,7 +2162,7 @@ async function onComfyDeleteWorkflowClick() {
if (!confirm) {
return;
}
const response = await fetch('/api/sd/comfy/deleteWorkflow', {
const response = await fetch('/api/sd/comfy/delete-workflow', {
method: 'POST',
headers: getRequestHeaders(),
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 {
writeFileAtomicSync(
`${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 {
let path = `${DIRECTORIES.comfyWorkflows}/${sanitize(String(request.body.file_name))}`;
if (fs.existsSync(path)) {