Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing id param in function example in code example #277

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

matheuschimelli
Copy link

In the docs, there is an piece of code that shows the following:

export const addTodo = async (id: number, text: string) => {
  await db.insert(todo).values({
    id: id,
    text: text,
  });
};

But at in the end, in the topic: "Establish server-side functions", it was wrong, because the functions didn't provided the function param to pass the id, causing a type error in typescript.

The code now fix that error.

In the docs, there is an piece of code that shows the following:
```js
export const addTodo = async (id: number, text: string) => {
  await db.insert(todo).values({
    id: id,
    text: text,
  });
};
```
But at in the end, in the topic: "Establish server-side functions", it was wrong, because the functions didn't provided the function param to pass the id, causing a type error in typescript.

The code now fix that error.
@matheuschimelli matheuschimelli changed the title Fix missing id param in function example in code example fix: missing id param in function example in code example Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant