[ghost] How to change post URLs with admin API

When you register a post using the ghost Admin API, post title is set to URL.
If you want to fix the post URL to the desired URL, first register the desired URL (number, etc.) as the post title, and then change it to the post title you will actually use using the post editing API.
You can use the post URL and title differently.

// create post with number title
api.posts.add(
    {title: number, html},
    {source: 'html'}, // Tell the API to use HTML as the content source, instead of Lexical
    {status: 'published'},
    {tags: [category]},
    {authors: ['extflash@gmail.com']},
    {published_at: time},
    {feature_image: feature}
)
.then(res => {
    console.log("registered.", JSON.stringify(res.id), title)
    //edit post title
    api.posts.edit({id: res.id, title: title, status: 'published', tags: [category], feature_image: feature, updated_at: res.updated_at});

    console.log("edited.")
})
.catch(err => console.log(err));