Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.vercel
.env*.local
19 changes: 18 additions & 1 deletion api/_lib/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const {
sendJson,
} = require('./http');
const { sendSubmissionNotification } = require('./ntfy');
const staticCommissions = require('./static-commissions.json');

const SUBMISSION_RATE_LIMIT_WINDOW_MS = 10 * 60 * 1000;
const SUBMISSION_RATE_LIMIT_MAX = 5;
Expand Down Expand Up @@ -293,8 +294,24 @@ async function handleListPublicCommissions(req, res) {
noStore(res);

try {
let dynamicCommissions = [];
try {
dynamicCommissions = await getPublicCommissions();
} catch (error) {
// If Blob-backed commissions are unavailable, still serve static commissions.
// Log the failure so production issues remain visible.
// eslint-disable-next-line no-console
console.error('Failed to load dynamic commissions:', error.message);
}

const dynamicIds = new Set(dynamicCommissions.map(entry => entry.id));
const merged = [
...dynamicCommissions,
...staticCommissions.filter(entry => !dynamicIds.has(entry.id)),
];

sendJson(res, 200, {
commissions: await getPublicCommissions(),
commissions: merged,
});
} catch (error) {
sendError(
Expand Down
28 changes: 28 additions & 0 deletions api/_lib/static-commissions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[
{
"id": "static_screenshot_proto_20260726",
"artistName": "screenshot.proto",
"artistLink": "https://www.tiktok.com/@screenshot.proto",
"date": "2026-07-26",
"description": "",
"gridIndex": null,
"imageUrl": "/custom/commissions/screenshot-proto-2026-07-26.webp",
"iconUrl": "/custom/commissions/icons/screenshot-proto-2026-07-26.png",
"mimeType": "image/webp",
"width": 3464,
"height": 3464
},
{
"id": "static_veevee_20260730",
"artistName": "veevee",
"artistLink": "https://lightdrawingzs.carrd.co/",
"date": "2026-07-30",
"description": "",
"gridIndex": null,
"imageUrl": "/custom/commissions/veevee-2026-07-30.webp",
"iconUrl": "/custom/commissions/icons/veevee-2026-07-30.png",
"mimeType": "image/webp",
"width": 1280,
"height": 1280
}
]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/custom/commissions/veevee-2026-07-30.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading