Comments (18)
Url and Excerpt have no effect, PublishedAt says: Unhandled exception. Validation error, cannot edit post - printing both dates - from source post and from a created post seem to be of the same format
from ghostsharp.
I just realised from your reply on the ghost forum that I should've used slug and not url, this one's working!
from ghostsharp.
Well, as I investigate, turns out I needed to use CustomExcerpt, not just Excerpt, so this one's off, too)
from ghostsharp.
Appreciate you letting me know, and troubleshooting it too. :)
Not all the fields are able to be changed/updated (like Url), and although I have them marked in the Post class itself, I'm not sure how best to convey that info clearly to whoever's using this. Maybe I should just put it right in the description on certain properties or something.
- I'll double-check
Excerpt
, but maybe that's a field that Ghost calculates itself, andCustomExcerpt
overrides it if present? - I have
PublishedAt
marked as updateable, but that "validation error, cannot edit post" message most likely means it's not... I'll check. It's probably calculated automatically when a post is published or something.
from ghostsharp.
I think this is the last thing I need to actually finish the script that I'm writing)
from ghostsharp.
Regarding what to do with these properties - make the setter private.
Also, Id of a post is not editable, I guess?
from ghostsharp.
I just released v1.0.8 to NuGet, so when that's available hopefully it'll work much better. That was a good idea with the private setters - no clue why I didn't do it that way from the beginning.
from ghostsharp.
Still getting the same error with PublishedAt =(
from ghostsharp.
Would you mind showing me what you're doing with PublishedAt
, maybe even sharing some of your code?
I've got a test in there now that creates a post, then updates that field to be 20 minutes later, then compares the two objects to make sure the time was really updated as expected. It's passing, but I could imagine I'm missing some edge case...
from ghostsharp.
Try setting the time to the past. I'm creating a post with PublishedAt = DateTime. It works if you set it to DateTime.Now, actually, but doesn't if it's in the past.
from ghostsharp.
I just tried that too, with a different test that creates a post, then updates it with a PublishedAt value that's a year in the past, and it succeeds. I'm at a loss!
I'll look more into it, along with some other stuff I noticed (like, creating pages doesn't actually create pages.. just more posts), but I'm short on time this week. Might not get a chance to look at it until this weekend.
I saw your question on the Ghost forums too, but I don't have a definite answer for you on that either. Need to try it out myself.
from ghostsharp.
I just tried that too, with a different test that creates a post, then updates it with a PublishedAt value that's a year in the past, and it succeeds. I'm at a loss!
I'll look more into it, along with some other stuff I noticed (like, creating pages doesn't actually create pages.. just more posts), but I'm short on time this week. Might not get a chance to look at it until this weekend.
I saw your question on the Ghost forums too, but I don't have a definite answer for you on that either. Need to try it out myself.
For the DELETE /tags/ - I don't see that you have it implemented, but I'd like to contribute, if you let me and give me a small guide on how to use the project
from ghostsharp.
I made more changes, so creating pages is actually supported now. Not that you're interested in that part necessarily, just pointing it out.
I've got tests in there for updating pages and posts too, that cover the condition where a PublishedAt date is changed to something earlier - and they're both passing. So if it's still not working for you after updating to 1.0.9, seeing some code would really help.
As for deleting tags, it's not a stable endpoint yet, so I haven't put any time into it. There's no official api docs for it, but if you can do it via the Ghost web interface there's probably a way to support it. It would involve deleting tags while the browser console is open, watching the network tab to see when a call is made, and then digging through it to find the endpoint and the payload that it sends. It might be painful.
from ghostsharp.
Now it's saying the format is wrong o_O I tried setting it to Date of a wordpress post (using Wordpress PCL) and by creating a new DateTime (2020, 1, 1, 1, 1, 1);
from ghostsharp.
What's the full error? Are you getting that error when trying to create a post with a PublishedAt timestamp of Jan 1 2020?
from ghostsharp.
Got it working! Had to calculate the TimeSpan difference between DateTime.Now and the needed date and subtract that from DateTime.Now and then it worked!
Should I close the issue now?
from ghostsharp.
That's great, good to hear! Sure, I don't think there's a point in keeping this open, but let me know if you run into anything else.
I know you were trying to figure out the tags stuff, but I wouldn't know where to start with that quite yet, and I'd rather wait until their team feels things are stable on it.
from ghostsharp.
I actually deleted all the tags manually, so that's off the table)
from ghostsharp.
Related Issues (20)
- Support short form of Authors and Tags?
- More detailed error messages
- Replace NUnit with xUnit?
- Mention this wrapper to the Ghost team HOT 1
- Address CodeFactor issues
- Support multiple image uploads
- just some comments i had in the AdminAPI\IntegrationTests\UpdatePostIntgTests file
- update for the admin api - is themes a valid endpoint? HOT 4
- Support for subdirectories HOT 3
- Add constraints defined in schema.js?
- Still keep the UpdatedAt value the same? HOT 1
- Is send_email_when_published a working field or broken? HOT 1
- Resolve todo in Post.cs HOT 1
- Take a look at the other Ghost-SDK files to see if I missed anything in my implementation of things...
- Any info in here that could be applied to GhostSharp?
- Support async/await HOT 1
- codeinjection_head missing on getposts HOT 3
- The byte conversion code in the auth flow can now be replaced by a built-in method HOT 1
- Build process warning: 'HMACSHA256Algorithm' is obsolete:
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ghostsharp.