Skip to content

Commit

Permalink
fix: cleanup pr template method names
Browse files Browse the repository at this point in the history
  • Loading branch information
ndom91 committed Sep 13, 2024
1 parent e8bb66c commit d1d2e0c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion apps/desktop/src/lib/branch/BranchHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@
const prTemplatePath = project.git_host.pullRequestTemplatePath;
if (prTemplatePath) {
pullRequestTemplateBody = await $prService?.getPrTemplateContent(prTemplatePath, project.id);
pullRequestTemplateBody = await $prService?.pullRequestTemplateContent(
prTemplatePath,
project.id
);
}
if (pullRequestTemplateBody) {
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/lib/gitHost/github/githubPrService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class GitHubPrService implements GitHostPrService {
return new GitHubPrMonitor(this, prNumber);
}

async getPrTemplateContent(path: string, projectId: string) {
async pullRequestTemplateContent(path: string, projectId: string) {
try {
const fileContents: string | undefined = await invoke('get_pr_template_contents', {
relativePath: path,
Expand All @@ -108,7 +108,7 @@ export class GitHubPrService implements GitHostPrService {
}
}

async getAvailablePrTemplates(path: string): Promise<string[] | undefined> {
async availablePullRequestTemplates(path: string): Promise<string[] | undefined> {
// TODO: Find a workaround to avoid this dynamic import
// https://github.com/sveltejs/kit/issues/905
const { join } = await import('@tauri-apps/api/path');
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/lib/gitHost/interface/gitHostPrService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export interface GitHostPrService {
baseBranchName,
upstreamName
}: CreatePullRequestArgs): Promise<PullRequest>;
getAvailablePrTemplates(path: string): Promise<string[] | undefined>;
getPrTemplateContent(path: string, projectId: string): Promise<string | undefined>;
availablePullRequestTemplates(path: string): Promise<string[] | undefined>;
pullRequestTemplateContent(path: string, projectId: string): Promise<string | undefined>;
merge(method: MergeMethod, prNumber: number): Promise<void>;
prMonitor(prNumber: number): GitHostPrMonitor;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
$effect(() => {
if (!project.path) return;
$prService?.getAvailablePrTemplates(project.path).then((availableTemplates) => {
$prService?.availablePullRequestTemplates(project.path).then((availableTemplates) => {
if (availableTemplates) {
allAvailableTemplates = availableTemplates.map((availableTemplate) => {
const relativePath = availableTemplate.replace(`${project.path}/`, '');
Expand Down

0 comments on commit d1d2e0c

Please sign in to comment.