Added profile view

This commit is contained in:
Marcin-Ramotowski
2025-04-13 18:26:23 +02:00
parent 749a5529f2
commit e374df55de
6 changed files with 122 additions and 2 deletions

24
frontend/src/api/user.ts Normal file
View File

@ -0,0 +1,24 @@
import api from "./api";
export const getUser = async (userId: number) => {
const response = await api.get(`/users/${userId}`);
return response.data;
};
export const updateUser = async (
userId: number,
data: {
username: string;
email: string;
password?: string;
oldPassword?: string;
}
) => {
const response = await api.patch(`/users/${userId}`, data);
return response.data;
};
export const deleteUser = async (userId: number) => {
const response = await api.delete(`/users/${userId}`);
return response.data;
};