Skip to content

Commit

Permalink
docs: fix code block formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dhanushreddy291 committed Dec 17, 2024
1 parent a858d17 commit 22618bf
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions content/guides/azure-todo-static-web-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,9 @@ const getTodos = async () => {
// Table does not exist, so create it
await sql`
CREATE TABLE todos (
id SERIAL PRIMARY KEY,
text TEXT NOT NULL,
completed BOOLEAN NOT NULL
id SERIAL PRIMARY KEY,
text TEXT NOT NULL,
completed BOOLEAN NOT NULL
)`;
return [];
}
Expand Down Expand Up @@ -522,10 +522,10 @@ app.http('todos', {
}

const createdTodo = await sql`
INSERT INTO todos (text, completed)
VALUES (${newTodo.text}, ${newTodo.completed || false})
RETURNING *
`;
INSERT INTO todos (text, completed)
VALUES (${newTodo.text}, ${newTodo.completed || false})
RETURNING *
`;
return { status: 201, jsonBody: createdTodo };

case 'put':
Expand All @@ -540,11 +540,11 @@ app.http('todos', {
}

const todo = await sql`
UPDATE todos
SET completed = ${updatedTodo.completed}
WHERE id = ${updatedTodo.id}
RETURNING *
`;
UPDATE todos
SET completed = ${updatedTodo.completed}
WHERE id = ${updatedTodo.id}
RETURNING *
`;

if (todo.length === 0) {
return {
Expand All @@ -566,10 +566,10 @@ app.http('todos', {
}

const deletedTodo = await sql`
DELETE FROM todos
WHERE id = ${id}
RETURNING *
`;
DELETE FROM todos
WHERE id = ${id}
RETURNING *
`;

if (deletedTodo.length === 0) {
return {
Expand Down

0 comments on commit 22618bf

Please sign in to comment.