mirror of
https://github.com/ArthurDanjou/trpc-nuxt.git
synced 2026-01-30 19:57:54 +01:00
update example
This commit is contained in:
@@ -1,12 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { $client } = useNuxtApp()
|
const { $client } = useNuxtApp()
|
||||||
const { mutate } = $client.todo.addTodo.useMutation()
|
|
||||||
|
|
||||||
const addTodo = async () => {
|
const addTodo = async () => {
|
||||||
const title = Math.random().toString(36).slice(2, 7)
|
const title = Math.random().toString(36).slice(2, 7)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const x = await mutate({
|
const x = await $client.todo.addTodo.mutate({
|
||||||
id: Date.now(),
|
id: Date.now(),
|
||||||
userId: 69,
|
userId: 69,
|
||||||
title,
|
title,
|
||||||
|
|||||||
Reference in New Issue
Block a user