Fix debug upload persistence and UX; exclude prod audit log from DB restore
Uploads and fixes now bust browser cache via file-mtime keys in API responses. Debug upload shows a centered loading overlay and blocks search while uploading. Prod DB restore skips curator_audit_log. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
62096e8210
commit
f78c14f307
+9
-9
@@ -11,7 +11,7 @@ const { createSessionMiddleware } = require('./middleware/session');
|
||||
const { requireCurator } = require('./middleware/auth');
|
||||
const { logCuratorAction } = require('./audit-log');
|
||||
const authRoutes = require('./routes/auth');
|
||||
const { ensurePaintingImages, preloadArtistImagesLocal, replacePaintingImageFromUrl, replaceArtistPortraitFromUrl, clearPaintingImage, deletePainting, clearArtistPortrait, replacePaintingImageFromBuffer, replaceArtistPortraitFromBuffer, IMAGE_DIR } = require('./image-service');
|
||||
const { ensurePaintingImages, preloadArtistImagesLocal, replacePaintingImageFromUrl, replaceArtistPortraitFromUrl, clearPaintingImage, deletePainting, clearArtistPortrait, replacePaintingImageFromBuffer, replaceArtistPortraitFromBuffer, enrichPaintingRow, enrichArtistRow, IMAGE_DIR } = require('./image-service');
|
||||
const { getVersionInfo } = require('./version-info');
|
||||
const { searchGoogleImagesFirst, searchArtistPortraitFirst, searchPaintingImagesMany, searchArtistPortraitMany, fetchImageBuffer, friendlyImageFetchError, pickExt } = require('../scripts/image-fetcher');
|
||||
|
||||
@@ -32,10 +32,10 @@ app.use('/api/auth', authRoutes);
|
||||
app.use(
|
||||
'/images',
|
||||
express.static(IMAGE_DIR, {
|
||||
maxAge: '365d',
|
||||
immutable: true,
|
||||
etag: true,
|
||||
lastModified: true,
|
||||
setHeaders(res) {
|
||||
res.setHeader('Cache-Control', 'public, max-age=31536000, immutable');
|
||||
res.setHeader('Cache-Control', 'public, max-age=0, must-revalidate');
|
||||
},
|
||||
})
|
||||
);
|
||||
@@ -250,7 +250,7 @@ app.get('/api/movements/:id/gallery', async (req, res) => {
|
||||
|
||||
res.json({
|
||||
movement: movement.rows[0],
|
||||
paintings: paintings.rows,
|
||||
paintings: paintings.rows.map(enrichPaintingRow),
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
@@ -628,9 +628,9 @@ app.get('/api/artists/:id', async (req, res) => {
|
||||
}
|
||||
|
||||
res.json({
|
||||
artist: artist.rows[0],
|
||||
artist: enrichArtistRow(artist.rows[0]),
|
||||
periods: periods.rows,
|
||||
paintings: paintings.rows,
|
||||
paintings: paintings.rows.map(enrichPaintingRow),
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
@@ -786,9 +786,9 @@ app.get('/api/paintings/:id', async (req, res) => {
|
||||
]);
|
||||
|
||||
res.json({
|
||||
painting: painting.rows[0],
|
||||
painting: enrichPaintingRow(painting.rows[0]),
|
||||
influencedBy: influencedBy.rows,
|
||||
influenced: influenced.rows,
|
||||
influenced: influenced.rows.map(enrichPaintingRow),
|
||||
annotations: annotations.rows,
|
||||
});
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user