Skip to content

Instantly share code, notes, and snippets.

View MonteLogic's full-sized avatar
♂️

Monte Logic MonteLogic

♂️
View GitHub Profile
export const updateSummary = async (
entryID: string,
date: string,
routeID: string,
setSummaryObject: React.Dispatch<React.SetStateAction<any>>,
summaryObject: any,
) => {
alert('8, updateSummary');
// I'm pretty sure that BS id creation is coming from here:
try {
'use client';
import { useState, MouseEventHandler, useEffect } from 'react'; // Import MouseEventHandler
import Button from './button';
import { updateSummary, createRecordForSummary } from '#/app/utils/network-fns';
import TextareaAutosize from 'react-textarea-autosize';
import { UploadButton } from '#/app/utils/uploadthing';
import { ImageString } from './image-slider';
import StandardModal from './standard-modal';
import { FormattedRouteType } from '#/types/RouteTypes';
import { useSearchParams, usePathname, useRouter } from 'next/navigation';
'use client';
import { type WorkTime, type Routes, Prisma } from '@prisma/client';
import { useEffect, useState } from 'react';
import Button from './button';
import { set } from 'date-fns';
interface shiftsType {
name: string;
startTime: string;
@MonteLogic
MonteLogic / example-toDo-chamber.md
Last active April 23, 2024 16:33
Example toDo work chamber

Example toDo Chamber

[

  • 2x Get the route and date to be in a URL.

  • Date?

  • 2x - Enter a URL and have the search form bring up the route and/or Date which is in the URL.

  • Date?

@MonteLogic
MonteLogic / cb-work-notes-4.md
Last active May 7, 2024 17:33
Contractor Buddy Work Notes - Part 4

Contractor Buddy Work Notes - Part 4

Start: Tue 23 Apr 2024 10:48:29 AM CDT

Now, I have to turn those input results into object which will then be saved to the DB.

I need to pipe a setState into:

'use client'
import { useState, MouseEventHandler, useEffect } from 'react'; // Import MouseEventHandler
import Button from './button';
import { updateSummary } from '#/app/api/search-shift/network-fns';
import TextareaAutosize from 'react-textarea-autosize';
import { UploadButton } from "#/app/utils/uploadthing";
import { ImageString } from './image-slider';
import StandardModal from './standard-modal';
import { FormattedRouteType } from "#/types/RouteTypes";
import { useSearchParams, usePathname, useRouter } from 'next/navigation';
@MonteLogic
MonteLogic / crud-app-nextjs13-prisma-part1.md
Last active April 23, 2024 15:50
CRUD App Next.js 13, Prisma - Part 1
<?php
/**
* Starting update via different method.
*
* @param object $transient The update request for plugin.
*/
function myplugin_check_for_update( $transient ) {
error_log( 'hello' );
function getThisToWork() {
fetch('/wp-json/wp/v2/users/3', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'X-WP-Nonce': wpApiSettings.nonce, // replace with your nonce value
},
})
.then(response => response.json())
.then(data => {
@MonteLogic
MonteLogic / option.tsx
Last active January 5, 2023 19:06
WC Blocks option which contains some state logic related to the props. In studying to make the editor view changable on the shipping options.
/**
* External dependencies
*/
import classnames from 'classnames';
/**
* Internal dependencies
*/
import OptionLayout from './option-layout';
import type { RadioControlOptionProps } from './types';