ID of preset to update.
Partial preset data to update.
True if updated successfully, false if not found.
export function updateFilterPreset(
presetId: string,
updates: Partial<Omit<FilterPreset, "id" | "createdAt" | "updatedAt">>,
): boolean {
const presets = getFilterPresets();
const index = presets.findIndex((p) => p.id === presetId);
if (index === -1) {
console.error("[Storage] Filter preset not found:", presetId);
return false;
}
presets[index] = {
...presets[index],
...updates,
updatedAt: new Date().toISOString(),
};
saveFilterPresets(presets);
console.debug("[Storage] Updated filter preset:", presetId);
return true;
}
Updates an existing filter preset.