• Updates an existing filter preset.

    Parameters

    • presetId: string

      ID of preset to update.

    • updates: Partial<Omit<FilterPreset, "id" | "createdAt" | "updatedAt">>

      Partial preset data to update.

    Returns boolean

    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;
    }