Remove filtering colors by prank column, now that we've deleted it
This commit is contained in:
parent
054dd484a5
commit
35479bf80e
2 changed files with 10 additions and 13 deletions
|
@ -17,15 +17,12 @@ export async function getValidPetPoses() {
|
|||
const largestColorIdPromise = getLargestColorId(db);
|
||||
const distinctPetStatesPromise = getDistinctPetStates(db);
|
||||
|
||||
const [
|
||||
largestSpeciesId,
|
||||
largestColorId,
|
||||
distinctPetStates,
|
||||
] = await Promise.all([
|
||||
largestSpeciesIdPromise,
|
||||
largestColorIdPromise,
|
||||
distinctPetStatesPromise,
|
||||
]);
|
||||
const [largestSpeciesId, largestColorId, distinctPetStates] =
|
||||
await Promise.all([
|
||||
largestSpeciesIdPromise,
|
||||
largestColorIdPromise,
|
||||
distinctPetStatesPromise,
|
||||
]);
|
||||
|
||||
const poseStrs = new Set();
|
||||
for (const petState of distinctPetStates) {
|
||||
|
@ -90,7 +87,7 @@ async function getLargestSpeciesId(db) {
|
|||
}
|
||||
|
||||
async function getLargestColorId(db) {
|
||||
const [rows] = await db.query(`SELECT max(id) FROM colors WHERE prank = 0`);
|
||||
const [rows] = await db.query(`SELECT max(id) FROM colors`);
|
||||
return rows[0]["max(id)"];
|
||||
}
|
||||
|
||||
|
@ -124,7 +121,7 @@ async function handle(req, res) {
|
|||
async function handleWithBeeline(req, res) {
|
||||
beeline.withTrace(
|
||||
{ name: "api/validPetPoses", operation_name: "api/validPetPoses" },
|
||||
() => handle(req, res)
|
||||
() => handle(req, res),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ const buildColorLoader = (db) => {
|
|||
const colorLoader = new DataLoader(async (colorIds) => {
|
||||
const qs = colorIds.map((_) => "?").join(",");
|
||||
const [rows] = await db.execute(
|
||||
`SELECT * FROM colors WHERE id IN (${qs}) AND prank = 0`,
|
||||
`SELECT * FROM colors WHERE id IN (${qs})`,
|
||||
colorIds,
|
||||
);
|
||||
|
||||
|
@ -75,7 +75,7 @@ const buildColorLoader = (db) => {
|
|||
});
|
||||
|
||||
colorLoader.loadAll = async () => {
|
||||
const [rows] = await db.execute(`SELECT * FROM colors WHERE prank = 0`);
|
||||
const [rows] = await db.execute(`SELECT * FROM colors`);
|
||||
const entities = rows.map(normalizeRow);
|
||||
|
||||
for (const color of entities) {
|
||||
|
|
Loading…
Reference in a new issue