Skip to content

Instantly share code, notes, and snippets.

@AlessioGr
AlessioGr / PayloadCommunicator.ts
Last active February 11, 2025 23:14
Simple helper you can use to communicate with Payload CMS from your application via their REST API. Authorization via API key needs to be enabled in your users collection. More on enabling API keys here: https://payloadcms.com/docs/authentication/config#api-keys
import qs from 'qs';
export const cmsURL = "cms URL without the / at the end";
export const apiKey = "yourAPIkey";
export async function getDocuments (collectionName: string, whereQuery?) {
if (whereQuery) {
const stringifiedQuery = qs.stringify({
where: whereQuery
}, { addQueryPrefix: true });
@baumandm
baumandm / Chakra-UI x React-datepicker.md
Last active May 29, 2024 05:29
Chakra-UI x React-datepicker

⚠️ I'd recommend using this fork by @igoro00 which has better theme support.


Tiny wrapper component for React-Datepicker to stylistically fit with Chakra-UI 1.x.

<DatePicker selectedDate={myDate} onChange={(d) => console.log(d)} />