feat: Adds reset password api route, needs associated view route.

This commit is contained in:
2025-01-26 21:03:10 -05:00
parent 1f2bb900ca
commit d4a2048b12
5 changed files with 60 additions and 2 deletions

View File

@@ -121,6 +121,7 @@ public extension SiteRoute {
case create(User.Create)
case get(id: User.ID)
case index
case resetPassword(id: User.ID, request: User.ResetPassword)
case update(id: User.ID, updates: User.Update)
static let rootPath = "users"
@@ -143,6 +144,11 @@ public extension SiteRoute {
Path { rootPath }
Method.get
}
Route(.case(Self.resetPassword(id:request:))) {
Path { rootPath; User.ID.parser(); "reset-password" }
Method.patch
Body(.json(User.ResetPassword.self))
}
Route(.case(Self.update(id:updates:))) {
Path { rootPath; User.ID.parser() }
Method.patch