This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import colors from 'vuetify/es5/util/colors' | |
export default { | |
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode | |
ssr: false, | |
serverMiddleware:[ | |
'~/api/index.ts', | |
] , | |
// Global page headers: https://go.nuxtjs.dev/config-head | |
head: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gqlClient(query, variables = {}) { | |
return fetch("http://localhost:3000/admin/api", { | |
method: "POST", | |
headers: { | |
"Content-Type": "application/json", | |
}, | |
body: JSON.stringify({ | |
variables, | |
query, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<configSections> | |
</configSections> | |
<connectionStrings> | |
<add name="Dolphin_Accounts.Properties.Settings.sql_connection" | |
connectionString="Data Source=.\sqlexpress;Initial Catalog=dolphine;User ID=sa;Password=" /> | |
</connectionStrings> | |
<startup> | |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT invoice , | |
case | |
when isnull(sum(tr.cramount),0)>isnull(sum(tr.dramount),0) then isnull(sum(tr.cramount),0)-isnull(sum(tr.dramount),0) | |
else 0 | |
end as cr, | |
case | |
when isnull(sum(tr.dramount),0)>isnull(sum(tr.cramount),0) then isnull(sum(tr.dramount),0)-isnull(sum(tr.cramount),0) | |
else 0 | |
end as dr | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Slices extends React.Component { | |
render() { | |
if (this.props.slices) { | |
const pageContent = this.props.slices.map((slice, index) => { | |
if (slice.slice_type === "heading_slice") { | |
console.log('heading'); | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default async function fetcher<JSON = any>( | |
input: RequestInfo, | |
init?: RequestInit | |
): Promise<JSON> { | |
const res = await fetch(input, init) | |
return res.json() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Profile () { | |
const { data, error } = useSWR('/api/user/123', fetcher) | |
if (error) return <div>failed to load</div> | |
if (!data) return <div>loading...</div> | |
// render data | |
return <div>hello {data.name}!</div> | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const fetcher = (...args) => fetch(...args).then(res => res.json()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function SignUp() { | |
const { errors, values, handleChange, handleSubmit } = useForm(() => { | |
console.log('No errors found') | |
console.log('Can implement mutation here') | |
}, Validate) | |
return ( | |
<form ...>) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
const useLocalStorage=(key, initialValue,clearCache=false)=> { | |
// State to store our value | |
// Pass initial state function to useState so logic is only executed once | |
if(clearCache){window.localStorage.removeItem(key)} | |
const [storedValue, setStoredValue] = React.useState(() => { | |
try { | |
// Get from local storage by key | |
const item = window.localStorage.getItem(key); |