/
githubmirror
/
trpc
Обзор
Документация
Войти
/
githubmirror
/
trpc
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/next-formdata/src/server/routers/viewer.ts
19 строк
506 B
Alex / KATT
chore(server): rewrite `resolveHTTPResponse` with Fetch (#5684)
30 апр 2024, 22:54
Не верифицирован
30 апр 2024, 22:54
01bb2ea
Код
Авторство
О чём код?
import { uploadFileSchema } from '~/utils/schemas'; import { writeFileToDisk } from '~/utils/writeFileToDisk'; import { z } from 'zod'; import { publicProcedure, router } from '../trpc'; export const viewer = router({ updateProfile: publicProcedure .input( z.object({ formData: uploadFileSchema, }), ) .mutation(async (opts) => { return { name: opts.input.formData.name, image: await writeFileToDisk(opts.input.formData.image), }; }), });