Skip to content

Commit b8cac81

Browse files
author
Davide Mauri
committed
added owner_id to all PATCH as now required by DAB
1 parent bf14243 commit b8cac81

5 files changed

Lines changed: 11 additions & 9 deletions

File tree

client/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<link rel="icon" href="/favicon.ico">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<title>Todo Jamstack Demo v1.1</title>
7+
<title>Todo Jamstack Demo v1.1.3</title>
88
</head>
99
<body>
1010
<div id="app"></div>

client/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "todomvc-vue3-client",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"scripts": {
55
"dev": "vite",
66
"build": "vite build",

client/src/components/ToDoList.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,19 @@ export default {
148148
this.todos[sourceIndex].order = sourceIndex + 1
149149
this.todos[destIndex] = sourceTodo;
150150
this.todos[destIndex].order = destIndex + 1;
151+
152+
const userId = this.userId ?? "public";
151153
152154
fetch(API + `/id/${destTodo.id}`, {
153155
headers: HEADERS,
154156
method: "PATCH",
155-
body: JSON.stringify({ order: destTodo.order })
157+
body: JSON.stringify({ order: destTodo.order, owner_id: userId })
156158
});
157159
158160
fetch(API + `/id/${sourceTodo.id}`, {
159161
headers: HEADERS,
160162
method: "PATCH",
161-
body: JSON.stringify({ order: sourceTodo.order })
163+
body: JSON.stringify({ order: sourceTodo.order, owner_id: userId })
162164
});
163165
},
164166
@@ -202,7 +204,7 @@ export default {
202204
fetch(API + `/id/${todo.id}`, {
203205
headers: HEADERS,
204206
method: "PATCH",
205-
body: JSON.stringify({ completed: todo.completed, order: todo.order })
207+
body: JSON.stringify({ completed: todo.completed, order: todo.order, owner_id: this.userId ?? "public" })
206208
});
207209
},
208210
@@ -235,7 +237,7 @@ export default {
235237
fetch(API + `/id/${todo.id}`, {
236238
headers: HEADERS,
237239
method: "PATCH",
238-
body: JSON.stringify({ title: todo.title, order: todo.order })
240+
body: JSON.stringify({ title: todo.title, order: todo.order, owner_id: this.userId ?? "public" })
239241
});
240242
}
241243
},

swa-db-connections/staticwebapp.database.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://dataapibuilder.azureedge.net/schemas/latest/dab.draft.schema.json",
2+
"$schema": "https://github.com/Azure/data-api-builder/releases/download/v0.7.6/dab.draft.schema.json",
33
"data-source": {
44
"database-type": "mssql",
55
"connection-string": "@env('AZURE_SQL_APP_USER')"

0 commit comments

Comments
 (0)