feat: Fixes signup flow, begins updating form input fields.
This commit is contained in:
@@ -9,6 +9,7 @@ extension DatabaseClient {
|
||||
public struct UserProfile: Sendable {
|
||||
public var create: @Sendable (User.Profile.Create) async throws -> User.Profile
|
||||
public var delete: @Sendable (User.Profile.ID) async throws -> Void
|
||||
public var fetch: @Sendable (User.ID) async throws -> User.Profile?
|
||||
public var get: @Sendable (User.Profile.ID) async throws -> User.Profile?
|
||||
public var update: @Sendable (User.Profile.ID, User.Profile.Update) async throws -> User.Profile
|
||||
}
|
||||
@@ -32,6 +33,13 @@ extension DatabaseClient.UserProfile: TestDependencyKey {
|
||||
}
|
||||
try await model.delete(on: database)
|
||||
},
|
||||
fetch: { userID in
|
||||
try await UserProfileModel.query(on: database)
|
||||
.with(\.$user)
|
||||
.filter(\.$user.$id == userID)
|
||||
.first()
|
||||
.map { try $0.toDTO() }
|
||||
},
|
||||
get: { id in
|
||||
try await UserProfileModel.find(id, on: database)
|
||||
.map { try $0.toDTO() }
|
||||
|
||||
Reference in New Issue
Block a user