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 34b42ee commit 9b16e4b
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions content/guides/azure-todo-static-web-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,11 @@ const getTodos = async () => {
if (error.code === '42P01') {
// Table does not exist, so create it
await sql`
CREATE TABLE todos (
id SERIAL PRIMARY KEY,
text TEXT NOT NULL,
completed BOOLEAN NOT NULL
)`;
CREATE TABLE todos (
id SERIAL PRIMARY KEY,
text TEXT NOT NULL,
completed BOOLEAN NOT NULL
)`;
return [];
}
throw error;
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 9b16e4b

Please sign in to comment.