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
26 lines
571 B
Plaintext
26 lines
571 B
Plaintext
import { cache } from 'react';
|
|
export const getPreferences = cache(async (key, payload, userID, userSlug) => {
|
|
const result = await payload.find({
|
|
collection: 'payload-preferences',
|
|
depth: 0,
|
|
limit: 1,
|
|
pagination: false,
|
|
where: {
|
|
and: [{
|
|
key: {
|
|
equals: key
|
|
}
|
|
}, {
|
|
'user.relationTo': {
|
|
equals: userSlug
|
|
}
|
|
}, {
|
|
'user.value': {
|
|
equals: userID
|
|
}
|
|
}]
|
|
}
|
|
}).then(res => res.docs?.[0]);
|
|
return result;
|
|
});
|
|
//# sourceMappingURL=getPreferences.js.map |