Skip to content

Commit

Permalink
Add versionset filtering to sheets
Browse files Browse the repository at this point in the history
  • Loading branch information
jpalawaga committed Aug 22, 2017
1 parent 93a72fc commit 218d615
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions PlanGrid.Api.Tests/SheetTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,15 @@ public async Task UploadNewVersion()

await client.UploadVersion(TestData.Project2Uid, $"Version.{Guid.NewGuid()}", new VirtualFile { FileName = "Sample.pdf", Data = typeof(SheetTests).Assembly.GetManifestResourceStream("PlanGrid.Api.Tests.TestData.Sample.pdf") });
}

[Test]
public async Task GetSheetsByVersionSet()
{
IPlanGridApi client = PlanGridClient.Create();
Page<Sheet> sheets = await client.GetSheets(TestData.Project1Uid, version_set: TestData.Project1VersionSet1Uid);
Assert.Less(0, sheets.Data.Length);
Page<Sheet> sheets_empty = await client.GetSheets(TestData.Project1Uid, version_set: TestData.NotFoundUid);
Assert.AreEqual(0, sheets_empty.Data.Length);
}
}
}
2 changes: 1 addition & 1 deletion PlanGrid.Api/IPlanGridApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public interface IPlanGridApi : IDisposable
Task<Photo> UpdatePhoto(string projectUid, string photoUid, [Body]PhotoUpdate photo);

[Get("/projects/{projectUid}/sheets")]
Task<Page<Sheet>> GetSheets(string projectUid, int skip = Page.Skip, int limit = Page.Limit, DateTime? updated_after = null);
Task<Page<Sheet>> GetSheets(string projectUid, int skip = Page.Skip, int limit = Page.Limit, DateTime? updated_after = null, string version_set = null);

[Get("/projects/{projectUid}/snapshots/{snapshotUid}")]
Task<Snapshot> GetSnapshot(string projectUid, string snapshotUid);
Expand Down

0 comments on commit 218d615

Please sign in to comment.