demo 20-4-2026
This commit is contained in:
@@ -33,7 +33,7 @@ router.get("/:z/:x/:y", (req, res) => {
|
||||
const y = Number(req.params.y);
|
||||
|
||||
if (!Number.isInteger(z) || !Number.isInteger(x) || !Number.isInteger(y)) {
|
||||
return res.status(400).send("Invalid tile coordinates");
|
||||
return res.status(400).json({ error: "Invalid tile coordinates" });
|
||||
}
|
||||
|
||||
const tmsY = (1 << z) - 1 - y;
|
||||
@@ -47,7 +47,7 @@ router.get("/:z/:x/:y", (req, res) => {
|
||||
`).get(z, x, tmsY);
|
||||
|
||||
if (!tile) {
|
||||
return res.status(404).send("Tile not found");
|
||||
return res.status(404).json({ error: "Tile not found" });
|
||||
}
|
||||
|
||||
res.setHeader("Content-Type", contentType);
|
||||
|
||||
@@ -289,9 +289,9 @@ router.post("/:sectionId/submit", (req, res) => {
|
||||
throw createHttpError("Section is not editable", 409);
|
||||
}
|
||||
|
||||
const commitId = normalizeId(req.body?.commit_id) || state.head_commit_id;
|
||||
const commitId = state.head_commit_id;
|
||||
if (!commitId) {
|
||||
throw createHttpError("Section has no commit to submit", 400);
|
||||
throw createHttpError("Section has no head commit to submit", 400);
|
||||
}
|
||||
|
||||
const commit = getCommitForSection(section.id, commitId);
|
||||
|
||||
@@ -47,7 +47,7 @@ router.get("/:z/:x/:y", (req, res) => {
|
||||
const y = Number(req.params.y);
|
||||
|
||||
if (!Number.isInteger(z) || !Number.isInteger(x) || !Number.isInteger(y)) {
|
||||
return res.status(400).send("Invalid tile coordinates");
|
||||
return res.status(400).json({ error: "Invalid tile coordinates" });
|
||||
}
|
||||
|
||||
// convert XYZ → TMS
|
||||
@@ -64,7 +64,7 @@ router.get("/:z/:x/:y", (req, res) => {
|
||||
const tile = stmt.get(z, x, tmsY);
|
||||
|
||||
if (!tile) {
|
||||
return res.status(404).send("Tile not found");
|
||||
return res.status(404).json({ error: "Tile not found" });
|
||||
}
|
||||
|
||||
res.setHeader("Content-Type", contentType);
|
||||
|
||||
Reference in New Issue
Block a user