mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-23 15:37:50 +01:00
Fix sendless statuses
This commit is contained in:
parent
56c99000c4
commit
a86735d743
@ -152,7 +152,7 @@ router.post('/status', jsonParser, async function (request, response) {
|
|||||||
|
|
||||||
if (!modelsReply.ok) {
|
if (!modelsReply.ok) {
|
||||||
console.log('Models endpoint is offline.');
|
console.log('Models endpoint is offline.');
|
||||||
return response.status(400);
|
return response.sendStatus(400);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @type {any} */
|
/** @type {any} */
|
||||||
@ -173,7 +173,7 @@ router.post('/status', jsonParser, async function (request, response) {
|
|||||||
|
|
||||||
if (!Array.isArray(data.data)) {
|
if (!Array.isArray(data.data)) {
|
||||||
console.log('Models response is not an array.');
|
console.log('Models response is not an array.');
|
||||||
return response.status(400);
|
return response.sendStatus(400);
|
||||||
}
|
}
|
||||||
|
|
||||||
const modelIds = data.data.map(x => x.id);
|
const modelIds = data.data.map(x => x.id);
|
||||||
@ -224,7 +224,7 @@ router.post('/status', jsonParser, async function (request, response) {
|
|||||||
return response.send({ result, data: data.data });
|
return response.send({ result, data: data.data });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return response.status(500);
|
return response.sendStatus(500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ router.post('/props', jsonParser, async function (request, response) {
|
|||||||
const propsReply = await fetch(propsUrl, args);
|
const propsReply = await fetch(propsUrl, args);
|
||||||
|
|
||||||
if (!propsReply.ok) {
|
if (!propsReply.ok) {
|
||||||
return response.status(400);
|
return response.sendStatus(400);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @type {any} */
|
/** @type {any} */
|
||||||
@ -258,7 +258,7 @@ router.post('/props', jsonParser, async function (request, response) {
|
|||||||
return response.send(props);
|
return response.send(props);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return response.status(500);
|
return response.sendStatus(500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -450,7 +450,7 @@ ollama.post('/download', jsonParser, async function (request, response) {
|
|||||||
return response.send({ ok: true });
|
return response.send({ ok: true });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return response.status(500);
|
return response.sendStatus(500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -493,7 +493,7 @@ ollama.post('/caption-image', jsonParser, async function (request, response) {
|
|||||||
return response.send({ caption });
|
return response.send({ caption });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return response.status(500);
|
return response.sendStatus(500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -540,7 +540,7 @@ llamacpp.post('/caption-image', jsonParser, async function (request, response) {
|
|||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return response.status(500);
|
return response.sendStatus(500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -569,7 +569,7 @@ llamacpp.post('/props', jsonParser, async function (request, response) {
|
|||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return response.status(500);
|
return response.sendStatus(500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -619,7 +619,7 @@ llamacpp.post('/slots', jsonParser, async function (request, response) {
|
|||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return response.status(500);
|
return response.sendStatus(500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -665,7 +665,7 @@ tabby.post('/download', jsonParser, async function (request, response) {
|
|||||||
return response.send({ ok: true });
|
return response.send({ ok: true });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return response.status(500);
|
return response.sendStatus(500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user