diff --git a/public/index.html b/public/index.html index ac89505..a287fc9 100644 --- a/public/index.html +++ b/public/index.html @@ -294,6 +294,6 @@ - + diff --git a/public/js/jobs.js b/public/js/jobs.js index 06b8555..67e8faf 100644 --- a/public/js/jobs.js +++ b/public/js/jobs.js @@ -268,7 +268,7 @@ async function pollJobStatus(jobId, isEdit) { } export function renderJobSuccess(data, isEdit) { - const version = data.result?.version; + const version = data.version || data.result?.version; const resultImage = document.querySelector("#result-image"); const resultPlaceholder = document.querySelector("#result-placeholder"); const resultLabel = document.querySelector("#result-label"); diff --git a/src/http/routes/jobs.routes.js b/src/http/routes/jobs.routes.js index 940469f..6f12239 100644 --- a/src/http/routes/jobs.routes.js +++ b/src/http/routes/jobs.routes.js @@ -14,6 +14,7 @@ function createJobsRoutes({ jobService }) { router.get("/jobs", (req, res, next) => { try { + res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); res.json({ ok: true, jobs: jobService.listJobs() }); } catch (err) { next(err); @@ -22,6 +23,7 @@ function createJobsRoutes({ jobService }) { router.get("/jobs/:id/status", (req, res, next) => { try { + res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); const { id } = req.params; if (!JOB_ID_PATTERN.test(id)) { throw new BadRequestError("Некорректный идентификатор задания.");