Skip to content

Commit

Permalink
chore: add post demo
Browse files Browse the repository at this point in the history
  • Loading branch information
martinalbert committed Oct 28, 2024
1 parent 15c06e2 commit 2db792a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ static void Main(string[] args)
var pageResponse = client.RetrievePage<PageFields>("*", "test-page-1", parameters);
var page = pageResponse.Data;
Console.WriteLine("Page retrieved successfully");
Console.WriteLine($"Page: {page}");
Console.WriteLine($"Page Slug: {page.Slug}");
Console.WriteLine($"Page Status: {page.Status}");
Console.WriteLine($"Page Scheduled: {page.Scheduled}");
Expand All @@ -46,6 +45,20 @@ static void Main(string[] args)
{
Console.WriteLine($"Error fetching page: {ex.Message}");
}

try
{
var postResponse = client.RetrievePost("test-blog-post");
var post = postResponse.Data;
Console.WriteLine("Post retrieved successfully");
Console.WriteLine($"Post Slug: {post.Slug}");
Console.WriteLine($"Post Status: {post.Status}");
Console.WriteLine($"Post Scheduled: {post.Scheduled}");
}
catch (Exception ex)
{
Console.WriteLine($"Error fetching post: {ex.Message}");
}
}
}
}

0 comments on commit 2db792a

Please sign in to comment.