mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-01-30 06:10:56 +01:00
feature: Commit Log Viewer (#7)
* style: slightly decrease font / button size for repo container * feat: view commit modal to view local commit details * fix: allow staging and comitting deleted files * feat: handle modify-delete edge case - local side deleted, remote modified - let user pick between restore, keep deleted - special handling for editing * feat: handle empty state for commits modal
This commit is contained in:
@@ -479,3 +479,32 @@ export const abortMerge = async () => {
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
export const getCommitHistory = async (branch = null) => {
|
||||
try {
|
||||
const url = new URL(`${API_BASE_URL}/git/commits`);
|
||||
if (branch) {
|
||||
url.searchParams.append('branch', branch);
|
||||
}
|
||||
|
||||
const response = await axios.get(url.toString(), {
|
||||
validateStatus: status => {
|
||||
return (status >= 200 && status < 300) || status === 400;
|
||||
}
|
||||
});
|
||||
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.error('Error fetching commit history:', error);
|
||||
if (error.response?.data) {
|
||||
return {
|
||||
success: false,
|
||||
error: error.response.data.error
|
||||
};
|
||||
}
|
||||
return {
|
||||
success: false,
|
||||
error: 'Failed to fetch commit history'
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user