Run pre-commit hooks over existing codebase

Co-Authored-By: Ben Phelps <ben@phelps.io>
This commit is contained in:
shamoon
2023-10-17 23:26:55 -07:00
parent fa50bbad9c
commit 19c25713c4
387 changed files with 4785 additions and 4109 deletions

View File

@@ -21,16 +21,16 @@ export default async function photoprismProxyHandler(req, res) {
}
const url = new URL(formatApiCall("{url}/api/v1/session", { ...widget }));
const params = {
method: "POST",
headers: { "Content-Type": "application/json" },
body: null
const params = {
method: "POST",
headers: { "Content-Type": "application/json" },
body: null,
};
if (widget.username && widget.password) {
params.body = JSON.stringify({
"username": widget.username,
"password": widget.password
username: widget.username,
password: widget.password,
});
}
@@ -38,11 +38,11 @@ export default async function photoprismProxyHandler(req, res) {
if (status !== 200) {
logger.error("HTTP %d getting data from PhotoPrism. Data: %s", status, data);
return res.status(status).json({error: {message: `HTTP Error ${status}`, url, data}});
return res.status(status).json({ error: { message: `HTTP Error ${status}`, url, data } });
}
const json = JSON.parse(data.toString())
const json = JSON.parse(data.toString());
if (contentType) res.setHeader("Content-Type", contentType);
return res.status(200).send(json?.config?.count);
}