mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
Run pre-commit hooks over existing codebase
Co-Authored-By: Ben Phelps <ben@phelps.io>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user