request password reset form

This commit is contained in:
Hayden 2024-04-28 11:42:37 -05:00
parent ef06e4fbb2
commit c83d178182
No known key found for this signature in database
GPG key ID: 17CF79474E257545
2 changed files with 72 additions and 8 deletions

View file

@ -1,5 +1,11 @@
import { BaseAPI, route } from "./base";
import type { APISummary, LoginForm, TokenResponse, UserRegistration } from "./types/data-contracts";
import type {
APISummary,
LoginForm,
PasswordResetRequest,
TokenResponse,
UserRegistration,
} from "./types/data-contracts";
export type StatusResult = {
health: boolean;
@ -27,4 +33,11 @@ export class PublicApi extends BaseAPI {
public register(body: UserRegistration) {
return this.http.post<UserRegistration, TokenResponse>({ url: route("/users/register"), body });
}
public resetPasseord(email: string) {
return this.http.post<PasswordResetRequest, void>({
url: route("/users/request-password-reset"),
body: { email },
});
}
}