feat(profiles): Add basic functionality for profile page

- Create ProfileCard and ProfileModal components
- Implement profile.py backend file for CRUD operations
- Update API file with profile-related functions
- Modify main application file to include profile blueprint
- Add profile directory initialization
This commit is contained in:
santiagosayshey
2024-08-24 00:55:39 +09:30
committed by Sam Chau
parent 330c162b0e
commit 8cb3d7a827
9 changed files with 547 additions and 6 deletions

View File

@@ -244,3 +244,43 @@ export const getDiff = async (filePath) => {
throw error;
}
};
export const getProfiles = async () => {
try {
const response = await axios.get(`${API_BASE_URL}/profile`);
return response.data;
} catch (error) {
console.error('Error fetching profiles:', error);
throw error;
}
};
export const saveProfile = async (profile) => {
try {
const response = await axios.post(`${API_BASE_URL}/profile`, profile);
return response.data;
} catch (error) {
console.error('Error saving profile:', error);
throw error;
}
};
export const updateProfile = async (id, profile) => {
try {
const response = await axios.put(`${API_BASE_URL}/profile/${id}`, profile);
return response.data;
} catch (error) {
console.error('Error updating profile:', error);
throw error;
}
};
export const deleteProfile = async (id) => {
try {
const response = await axios.delete(`${API_BASE_URL}/profile/${id}`);
return response.data;
} catch (error) {
console.error('Error deleting profile:', error);
throw error;
}
};