mirror of
https://github.com/ArthurDanjou/website.git
synced 2026-01-25 17:30:32 +01:00
updating nuxt and fixing errors
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import process from 'node:process'
|
||||
import { PrismaClient } from '@prisma/client/edge'
|
||||
|
||||
const globalForPrisma = globalThis as unknown as { prisma: PrismaClient }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { inferAsyncReturnType } from '@trpc/server'
|
||||
import type { H3Event } from 'h3'
|
||||
import { prisma } from '~/server/prisma'
|
||||
import { prisma } from '../prisma'
|
||||
|
||||
export function createContext(_event: H3Event) {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { publicProcedure, router } from '~/server/trpc/trpc'
|
||||
import { publicProcedure, router } from '../trpc'
|
||||
|
||||
export default router({
|
||||
get: publicProcedure
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import announcement from '~/server/trpc/routers/announcement'
|
||||
import maintenance from '~/server/trpc/routers/maintenance'
|
||||
import talents from '~/server/trpc/routers/talents'
|
||||
import post from '~/server/trpc/routers/post'
|
||||
import { router } from '~/server/trpc/trpc'
|
||||
import { router } from '../trpc'
|
||||
import announcement from './announcement'
|
||||
import maintenance from './maintenance'
|
||||
import post from './post'
|
||||
import talents from './talents'
|
||||
|
||||
export const appRouter = router({
|
||||
announcement,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { publicProcedure, router } from '~/server/trpc/trpc'
|
||||
import { publicProcedure, router } from '../trpc'
|
||||
|
||||
export default router({
|
||||
get: publicProcedure
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { object, string } from 'valibot'
|
||||
import { publicProcedure, router } from '~/server/trpc/trpc'
|
||||
import { z } from 'zod'
|
||||
import { publicProcedure, router } from '../trpc'
|
||||
|
||||
const PostSchema = object({
|
||||
slug: string(),
|
||||
const PostSchema = z.object({
|
||||
slug: z.string(),
|
||||
})
|
||||
|
||||
export default router({
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { boolean, literal, object, string, union } from 'valibot'
|
||||
import { publicProcedure, router } from '~/server/trpc/trpc'
|
||||
import { z } from 'zod'
|
||||
import { publicProcedure, router } from '../trpc'
|
||||
|
||||
export default router({
|
||||
getTalents: publicProcedure
|
||||
.input(object({
|
||||
favorite: boolean(),
|
||||
category: union([string(), literal('all')]),
|
||||
.input(z.object({
|
||||
favorite: z.boolean(),
|
||||
category: z.union([z.string(), z.literal('all')]),
|
||||
}))
|
||||
.query(async ({ ctx, input }) => {
|
||||
if (input.favorite) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { initTRPC } from '@trpc/server'
|
||||
import SuperJSON from 'superjson'
|
||||
import type { Context } from '~/server/trpc/context'
|
||||
import type { Context } from './context'
|
||||
|
||||
const trpc = initTRPC.context<Context>().create({
|
||||
transformer: SuperJSON,
|
||||
|
||||
Reference in New Issue
Block a user