Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/GitHub.App/Services/ModelService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,15 @@ public ITrackingCollection<IRepositoryModel> GetRepositories(ITrackingCollection
return collection;
}

public IObservable<IPullRequestModel> CreatePullRequest(ISimpleRepositoryModel repository, string title, IBranch source, IBranch target)
public IObservable<IPullRequestModel> CreatePullRequest(ISimpleRepositoryModel repository, string title, string body, IBranch source, IBranch target)
{
var keyobs = GetUserFromCache()
.Select(user => string.Format(CultureInfo.InvariantCulture, "{0}|{1}:{2}", CacheIndex.PRPrefix, user.Login, repository.Name));

return Observable.Defer(() => keyobs
.SelectMany(key =>
hostCache.PutAndUpdateIndex(key, () =>
apiClient.CreatePullRequest(new NewPullRequest(title, source.Name, target.Name),
apiClient.CreatePullRequest(new NewPullRequest(title, source.Name, target.Name) { Body = body },
repository.CloneUrl.Owner,
repository.CloneUrl.RepositoryName)
.Select(PullRequestCacheItem.Create),
Expand Down
4 changes: 2 additions & 2 deletions src/GitHub.App/Services/PullRequestService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ namespace GitHub.Services
[PartCreationPolicy(CreationPolicy.Shared)]
public class PullRequestService : IPullRequestService
{
public IObservable<IPullRequestModel> CreatePullRequest(IRepositoryHost host, ISimpleRepositoryModel repository, string title, IBranch source, IBranch target)
public IObservable<IPullRequestModel> CreatePullRequest(IRepositoryHost host, ISimpleRepositoryModel repository, string title, string body, IBranch source, IBranch target)
{
return host.ModelService.CreatePullRequest(repository, title, source, target);
return host.ModelService.CreatePullRequest(repository, title, body, source, target);
}
}
}
2 changes: 1 addition & 1 deletion src/GitHub.App/ViewModels/PullRequestCreationViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public PullRequestCreationViewModel(IRepositoryHost repositoryHost, ISimpleRepos
.Subscribe(x => notifications.ShowError(BranchValidator.ValidationResult.Message));

createPullRequest = ReactiveCommand.CreateAsyncObservable(whenAnyValidationResultChanges,
_ => service.CreatePullRequest(repositoryHost, activeRepo, PRTitle, SourceBranch, TargetBranch)
_ => service.CreatePullRequest(repositoryHost, activeRepo, PRTitle, Description, SourceBranch, TargetBranch)
);
createPullRequest.ThrownExceptions.Subscribe(ex =>
{
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub.Exports.Reactive/Services/IModelService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface IModelService : IDisposable
IObservable<LicenseItem> GetLicenses();
IObservable<GitIgnoreItem> GetGitIgnoreTemplates();
ITrackingCollection<IPullRequestModel> GetPullRequests(ISimpleRepositoryModel repo, ITrackingCollection<IPullRequestModel> collection);
IObservable<IPullRequestModel> CreatePullRequest(ISimpleRepositoryModel repository, string title, IBranch source, IBranch target);
IObservable<IPullRequestModel> CreatePullRequest(ISimpleRepositoryModel repository, string title, string body, IBranch source, IBranch target);
IObservable<IBranch> GetBranches(ISimpleRepositoryModel repo);
IObservable<Unit> InvalidateAll();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ namespace GitHub.Services
{
public interface IPullRequestService
{
IObservable<IPullRequestModel> CreatePullRequest(IRepositoryHost host, ISimpleRepositoryModel repository, string title, IBranch source, IBranch target);
IObservable<IPullRequestModel> CreatePullRequest(IRepositoryHost host, ISimpleRepositoryModel repository, string title, string body, IBranch source, IBranch target);
}
}