fix(recommendation-engine): S4-FIX — opersonliga vyer fungerar utan samtycke via depersonalize(weights)
This commit is contained in:
@@ -11,8 +11,8 @@ import {
|
||||
type PantryItem,
|
||||
} from "@app/recipe-engine";
|
||||
import {
|
||||
depersonalize,
|
||||
isEventActive,
|
||||
NON_PERSONALIZED_WEIGHTS,
|
||||
parseCraving,
|
||||
rankAll,
|
||||
seasonForDate,
|
||||
@@ -389,10 +389,8 @@ export async function recommendationRoutes(app: FastifyInstance) {
|
||||
}
|
||||
|
||||
const weights = personalizationEnabled
|
||||
? q.view === "default"
|
||||
? undefined
|
||||
: viewWeights(q.view)
|
||||
: NON_PERSONALIZED_WEIGHTS;
|
||||
? viewWeights(q.view)
|
||||
: depersonalize(viewWeights(q.view));
|
||||
let recommendations = rankAll(scoredCandidates, ctx, weights, q.limit);
|
||||
|
||||
// --- 9. AAMOS-omrankning bakom feature flag (aldrig obligatorisk) ---
|
||||
@@ -457,7 +455,7 @@ export async function recommendationRoutes(app: FastifyInstance) {
|
||||
remainingKcal: ctx.remainingKcal,
|
||||
remainingProteinG: ctx.remainingProteinG,
|
||||
craving: craving ?? null,
|
||||
view: personalizationEnabled ? q.view : "default",
|
||||
view: q.view,
|
||||
},
|
||||
mealBoxSuggestions,
|
||||
recommendations,
|
||||
|
||||
Reference in New Issue
Block a user