export const openGateServer = createServerFn()
.inputValidator((data: { gateId: string }) => data)
.handler(async ({ data }) => {
console.log('========================================')
console.log('SERVER FUNCTION CALLED')
console.log(
'Environment check - is this server?:',
typeof window === 'undefined',
)
console.log('========================================')
// Calling it from a component like this.
const openGate = useServerFn(openGateServer)
export const openGateServer = createServerFn()
.inputValidator((data: { gateId: string }) => data)
.handler(async ({ data }) => {
console.log('========================================')
console.log('SERVER FUNCTION CALLED')
console.log(
'Environment check - is this server?:',
typeof window === 'undefined',
)
console.log('========================================')
// Calling it from a component like this.
const openGate = useServerFn(openGateServer)