feat: merge Explore and Activity Feed, unify recipe cards
Explore and Feed covered overlapping ground (recommendations, following, trending) in two separate places with three different card designs. Explore now hosts Discover/Following/For You tabs, and every recipe card everywhere on the page matches the Recipes page's cover-photo card instead of the old text-only search result. v0.36.0
This commit is contained in:
@@ -2,6 +2,7 @@ import { NextRequest, NextResponse } from "next/server";
|
||||
import { db, recipes, users, userFollows, eq, and, ne, sql } from "@epicure/db";
|
||||
import { requireSessionOrApiKey } from "@/lib/api-auth";
|
||||
import { desc, inArray } from "@epicure/db";
|
||||
import { attachCardExtras } from "@/lib/recipe-card-extras";
|
||||
|
||||
export async function GET(req: NextRequest) {
|
||||
const { session, response } = await requireSessionOrApiKey(req);
|
||||
@@ -36,6 +37,10 @@ export async function GET(req: NextRequest) {
|
||||
cookMins: recipes.cookMins,
|
||||
difficulty: recipes.difficulty,
|
||||
visibility: recipes.visibility,
|
||||
tags: recipes.tags,
|
||||
isBatchCook: recipes.isBatchCook,
|
||||
sourceUrl: recipes.sourceUrl,
|
||||
recipeType: recipes.recipeType,
|
||||
createdAt: recipes.createdAt,
|
||||
updatedAt: recipes.updatedAt,
|
||||
authorId: recipes.authorId,
|
||||
@@ -57,6 +62,7 @@ export async function GET(req: NextRequest) {
|
||||
]);
|
||||
|
||||
const total = totalRow[0]?.total ?? 0;
|
||||
const data = await attachCardExtras(feedRecipes, session!.user.id);
|
||||
|
||||
return NextResponse.json({ data: feedRecipes, total, limit, offset });
|
||||
return NextResponse.json({ data, total, limit, offset });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user