Giter VIP home page Giter VIP logo

Comments (18)

unnanego avatar unnanego commented on June 12, 2024

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.

unnanego avatar unnanego commented on June 12, 2024

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.

unnanego avatar unnanego commented on June 12, 2024

Well, as I investigate, turns out I needed to use CustomExcerpt, not just Excerpt, so this one's off, too)

from ghostsharp.

grantwinney avatar grantwinney commented on June 12, 2024

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, and CustomExcerpt 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.

unnanego avatar unnanego commented on June 12, 2024

I think this is the last thing I need to actually finish the script that I'm writing)

from ghostsharp.

unnanego avatar unnanego commented on June 12, 2024

Regarding what to do with these properties - make the setter private.
Also, Id of a post is not editable, I guess?

from ghostsharp.

grantwinney avatar grantwinney commented on June 12, 2024

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. 🙄 It did require a larger refactoring though, so there may be a couple breaking changes for you to contend with. Let me know how it goes.

from ghostsharp.

unnanego avatar unnanego commented on June 12, 2024

Still getting the same error with PublishedAt =(

from ghostsharp.

grantwinney avatar grantwinney commented on June 12, 2024

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.

unnanego avatar unnanego commented on June 12, 2024

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.

grantwinney avatar grantwinney commented on June 12, 2024

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.

unnanego avatar unnanego commented on June 12, 2024

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.

grantwinney avatar grantwinney commented on June 12, 2024

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. 😏 And since it's listed as experimental, it's possible (I assume) that it could change without warning.

from ghostsharp.

unnanego avatar unnanego commented on June 12, 2024

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.

grantwinney avatar grantwinney commented on June 12, 2024

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.

unnanego avatar unnanego commented on June 12, 2024

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.

grantwinney avatar grantwinney commented on June 12, 2024

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.

unnanego avatar unnanego commented on June 12, 2024

I actually deleted all the tags manually, so that's off the table)

from ghostsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.