feat: enhance creation of recommendation keywords
This commit is contained in:
@ -54,7 +54,9 @@ const POST = async (
|
||||
movie.tags = [
|
||||
...new Set([
|
||||
...movie.tags.map((g) => g.toLowerCase()),
|
||||
...movieDetails.genres.map((g) => g.name?.toLowerCase()),
|
||||
...movieDetails.genres.map((g) =>
|
||||
g.name?.toLowerCase().replaceAll(" ", "-")
|
||||
),
|
||||
].filter(isString)),
|
||||
];
|
||||
}
|
||||
|
11
routes/api/recommendation/index.ts
Normal file
11
routes/api/recommendation/index.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { Handlers } from "$fresh/server.ts";
|
||||
import { json } from "@lib/helpers.ts";
|
||||
import { getAllRecommendations } from "@lib/recommendation.ts";
|
||||
|
||||
export const handler: Handlers = {
|
||||
async GET() {
|
||||
const recommendations = await getAllRecommendations();
|
||||
console.log({ recommendations });
|
||||
return json(recommendations);
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user