Files
klz-cables.com/.pnpm-store/v10/files/f1/a00f1b6b8e005de8f5607bc16c0226352b51e221c372d7fb91bee11d8642c7fd624874337af29b69fda365ed00ea4a38a5b6cabc1bd96d9bea138a65e14388
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

23 lines
1.4 KiB
Plaintext

import type { DefaultDocumentIDType, Payload, PayloadRequest } from 'payload';
type PreferenceDoc<T> = {
id: DefaultDocumentIDType | undefined;
value?: T | undefined;
};
type DefaultMerge = <T>(existingValue: T, incomingValue: T | undefined) => T;
export declare const getPreferences: <T>(key: string, payload: Payload, userID: DefaultDocumentIDType, userSlug: string) => Promise<PreferenceDoc<T>>;
/**
* Will update the given preferences by key, creating a new record if it doesn't already exist, or merging existing preferences with the new value.
* This is not possible to do with the existing `db.upsert` operation because it stores on the `value` key and does not perform a deep merge beyond the first level.
* I.e. if you have a preferences record with a `value` key, `db.upsert` will overwrite the existing value. In the future if this supported we should use that instead.
* @param req - The PayloadRequest object
* @param key - The key of the preferences to update
* @param value - The new value to merge with the existing preferences
*/
export declare const upsertPreferences: <T extends Record<string, unknown> | string>({ customMerge, key, req, value: incomingValue, }: {
customMerge?: (existingValue: T, incomingValue: T, defaultMerge: DefaultMerge) => T;
key: string;
req: PayloadRequest;
value: T;
}) => Promise<T>;
export {};
//# sourceMappingURL=upsertPreferences.d.ts.map