Skip to content

Instantly share code, notes, and snippets.

View notchris's full-sized avatar
🦆

Chris McGrane notchris

🦆
View GitHub Profile
import { z } from 'zod';
export const validateDealerSchema = z.object({
id: z.string(),
submitted: z.boolean(),
emailVerified: z.boolean(),
basicInformation: z.object({
firstName: z.string({
required_error: 'First name is required.',
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
{
"Afghanistan": "AF",
"Åland Islands": "AX",
"Albania": "AL",
"Algeria": "DZ",
"American Samoa": "AS",
"Andorra": "AD",
"Angola": "AO",
"Anguilla": "AI",
"Antarctica": "AQ",
// I have a "util.ts" file with this awful function the SDK uses for callbacks
const callback = (
exception: {
http_status_code: any;
is_timed_out: any;
message: any;
error_response: any;
invocation_context: any;
},
@notchris
notchris / snippet.ts
Created July 17, 2023 12:44
Get Country - Payload
export interface Country {
label: string;
value: string;
}
export function getCountries(): Country[] {
const countries: Country[] = [
{ label: "Afghanistan", value: "AF" },
{ label: "Albania", value: "AL" },
{ label: "Algeria", value: "DZ" },
@notchris
notchris / snippet.ts
Created July 17, 2023 12:44
Get U.S. States Payload
interface State {
label: string;
value: string;
}
export default function getUSStates(): State[] {
const usStates: State[] = [
{ label: "Alabama", value: "AL" },
{ label: "Alaska", value: "AK" },
{ label: "Arizona", value: "AZ" },
import React from "react";
import { Editor } from "slate";
import { useSlate } from "slate-react";
const name = "color_picker";
let color = "#000000";
const baseClass = "rich-text__button";
const isMarkActive = (editor, format) => {
// Email Messages
router.post("/payment-email", (req, res) => {
logger.info(`POST '/payment-email' OK`);
const { to, paymentData } = req.body;
if (!to) {
res.status(400).json({
message: "Invalid recipient provided.",
});
return;
import express from "express";
import payload from "payload";
import { PayloadRequest } from "payload/dist/express/types";
import cors from "cors";
require("dotenv").config();
const app = express();
const router = express.Router();
{"layout":[{"bannerTitle":"SAFS Online","bannerSubTitle":"This text can be edited through the control panel testing.","image":"6410a523f43502c29a7a7b09","id":"6422e1323268ff58322acd74","blockName":"Home Page Main Banner","blockType":"Banner"},{"aboutHeader":"About SAFS ","aboutContent":[{"children":[{"text":"This is the about section on the home page. This text can be edited in the admin panel to display information about SAFS."}]}],"image":"64134d5e2e8bed7bf60c223a","id":"6422e1433268ff58322acd75","blockName":"Home Page About Section","blockType":"About"},{"panels":[{"title":"Log me in","content":"Ready to get information?","link":"/login","icon":"person","id":"6422e1843268ff58322acd77"},{"title":"Register","content":"Learn how to get started with SAFS.","link":"/register","icon":"help","id":"6422e19e3268ff58322acd78"},{"title":"Events","content":"View calendar of Southern Events & Promotions.","link":"/events","icon":"events","id":"6422e1b33268ff58322acd79"},{"title":"Help & Support","content":"Get assistan