Skip to content

Commit 157254f

Browse files
committed
docs: fix example apps not building
1 parent 4dce37b commit 157254f

File tree

6 files changed

+25
-10
lines changed

6 files changed

+25
-10
lines changed

Examples/Examples/MFAFlow.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ struct MFAEnrollView: View {
9292
.task {
9393
do {
9494
error = nil
95-
enrollResponse = try await supabase.auth.mfa.enroll(params: MFAEnrollParams())
95+
enrollResponse = try await supabase.auth.mfa.enroll(params: .totp())
9696
} catch {
9797
self.error = error
9898
}

Examples/Examples/TodoListView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ struct TodoListView: View {
8181
do {
8282
error = nil
8383
todos = try await IdentifiedArrayOf(
84-
uniqueElements: supabase.database.from("todos")
84+
uniqueElements: supabase.from("todos")
8585
.select()
8686
.execute()
8787
.value as [Todo]
@@ -105,7 +105,7 @@ struct TodoListView: View {
105105
isComplete: updatedTodo.isComplete,
106106
ownerID: auth.currentUserID
107107
)
108-
updatedTodo = try await supabase.database.from("todos")
108+
updatedTodo = try await supabase.from("todos")
109109
.update(updateRequest, returning: .representation)
110110
.eq("id", value: updatedTodo.id)
111111
.single()
@@ -129,9 +129,9 @@ struct TodoListView: View {
129129

130130
todos.remove(atOffsets: offset)
131131

132-
try await supabase.database.from("todos")
132+
try await supabase.from("todos")
133133
.delete()
134-
.in("id", value: todosToDelete.map(\.id))
134+
.in("id", values: todosToDelete.map(\.id))
135135
.execute()
136136
} catch {
137137
self.error = error

Examples/SlackClone/ChannelStore.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ final class ChannelStore {
2727
let insertions = channel.postgresChange(InsertAction.self, table: "channels")
2828
let deletions = channel.postgresChange(DeleteAction.self, table: "channels")
2929

30-
await channel.subscribe()
30+
do {
31+
try await channel.subscribeWithError()
32+
} catch {
33+
print("Error subscribing to channel: \(error)")
34+
return
35+
}
3136

3237
Task {
3338
for await insertion in insertions {

Examples/SlackClone/MessageStore.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ final class MessageStore {
109109
let updates = channel.postgresChange(UpdateAction.self, table: "messages")
110110
let deletions = channel.postgresChange(DeleteAction.self, table: "messages")
111111

112-
await channel.subscribe()
112+
do {
113+
try await channel.subscribeWithError()
114+
} catch {
115+
print("Error subscribing to channel: \(error)")
116+
return
117+
}
113118

114119
Task {
115120
for await insertion in insertions {

Examples/SlackClone/UserStore.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ final class UserStore {
2424

2525
let presences = channel.presenceChange()
2626

27-
await channel.subscribe()
27+
do {
28+
try await channel.subscribeWithError()
29+
} catch {
30+
print("Error subscribing to channel: \(error)")
31+
return
32+
}
2833

2934
Task {
3035
let statusChange = channel.statusChange

Examples/UserManagement/ProfileView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ struct ProfileView: View {
172172
try await supabase.storage
173173
.from("avatars")
174174
.upload(
175-
path: filePath,
176-
file: data,
175+
filePath,
176+
data: data,
177177
options: FileOptions(contentType: "image/jpeg", upsert: true)
178178
)
179179

0 commit comments

Comments
 (0)