Dynamic payload for new seeds
Some checks failed
Tests / tests (push) Has been cancelled

This commit is contained in:
Dustin Brett 2025-11-30 21:45:38 -08:00
parent 2eca5f56ed
commit fa4b92bd46

View File

@ -58,46 +58,46 @@ export const wallpaperHandler: Record<string, WallpaperHandler> = {
};
},
ART_INSTITUTE_OF_CHICAGO: async () => {
const requestPayload = {
boost: false,
fields: ["image_id"],
limit: 1,
query: {
function_score: {
boost_mode: "replace",
query: {
bool: {
filter: [
{
term: {
is_public_domain: true,
},
},
{
terms: {
artwork_type_id: [1], // Painting
},
},
{
exists: {
field: "image_id",
},
},
],
},
},
random_score: {
field: "id",
seed: Date.now(),
},
},
},
};
// eslint-disable-next-line unicorn/consistent-function-scoping
const fetchArtwork = (): Promise<ArtInstituteOfChicagoResponse> =>
jsonFetch<ArtInstituteOfChicagoResponse>(
API_URL.ART_INSTITUTE_OF_CHICAGO,
{
body: JSON.stringify(requestPayload),
body: JSON.stringify({
boost: false,
fields: ["image_id"],
limit: 1,
query: {
function_score: {
boost_mode: "replace",
query: {
bool: {
filter: [
{
term: {
is_public_domain: true,
},
},
{
terms: {
artwork_type_id: [1], // Painting
},
},
{
exists: {
field: "image_id",
},
},
],
},
},
random_score: {
field: "id",
seed: Date.now(),
},
},
},
}),
headers: {
"Content-Type": "application/json",
},