Página de perfil e página de alterar perfil

This commit is contained in:
Matheus Albino Brunhara
2022-05-19 19:01:04 -05:00
parent 453c763f6d
commit a19ab7b85f
7 changed files with 213 additions and 66 deletions

View File

@@ -29,10 +29,16 @@ export interface CadastroResponse {
}
export interface CadastroRequest {
name: string;
email: string;
birth_date: string;
password: string;
name: string;
email: string;
birth_date: string;
password: string;
}
export interface UpdateUserRequest {
name: string;
email: string;
bio: string;
}
// export async function get(cpf) {
@@ -54,4 +60,11 @@ export async function getById(userId: string) {
const response = await instance.get(userRoutes.get.url + `/${userId}`, { headers: header });
return response.data;
}
export async function update(userData: UpdateUserRequest) {
updateHeader();
const response = await instance.patch(userRoutes.update.url, userData, { headers: header });
return response.data;
}