Skip to content

Commit

Permalink
fix: use new changes_in_commit rust API
Browse files Browse the repository at this point in the history
  • Loading branch information
ndom91 committed Feb 20, 2025
1 parent f76ee4e commit 94349d7
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions apps/desktop/src/lib/stacks/stackService.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,9 @@ export class StackService {
return result;
}

/**
* Does not support merge commits, i.e. 2 parent oldCommitId's yet.
*/
getCommitChanges(projectId: string, oldCommitId: string, newCommitId: string) {
getCommitChanges(projectId: string, commitId: string) {
const { getCommitChanges } = this.api.endpoints;
const result = $derived(getCommitChanges.useQuery({ projectId, oldCommitId, newCommitId }));
const result = $derived(getCommitChanges.useQuery({ projectId, commitId }));
return result;
}

Expand Down Expand Up @@ -117,16 +114,10 @@ function injectEndpoints(api: ClientState['backendApi']) {
}),
invalidatesTags: [ReduxTag.StackBranches, ReduxTag.Commit]
}),
/**
* Does not support merge commits, i.e. 2 parent oldCommitId's yet.
*/
getCommitChanges: build.query<
TreeChange[],
{ projectId: string; oldCommitId: string; newCommitId: string }
>({
query: ({ projectId, oldCommitId, newCommitId }) => ({
command: 'commit_changes',
params: { projectId, oldCommitId, newCommitId }
getCommitChanges: build.query<TreeChange[], { projectId: string; commitId: string }>({
query: ({ projectId, commitId }) => ({
command: 'changes_in_commit',
params: { projectId, commitId }
}),
providesTags: [ReduxTag.CommitChanges]
}),
Expand Down

0 comments on commit 94349d7

Please # to comment.