Skip to content
This repository has been archived by the owner on Feb 9, 2018. It is now read-only.

Allow creating new drafts and saving them #29

Closed
6 tasks done
vickychijwani opened this issue Apr 22, 2015 · 0 comments
Closed
6 tasks done

Allow creating new drafts and saving them #29

vickychijwani opened this issue Apr 22, 2015 · 0 comments
Milestone

Comments

@vickychijwani
Copy link
Owner

This issue belongs to the create / edit post epic: #5.


Notes on implementation

Experimentation with the /posts API reveals that it is very forgiving in general :). For example, the following short request will successfully create a new draft (of these parameters, only title and markdown are required):

POST /posts/

Content-Type: application/json; charset=utf-8
Authorization: Bearer <access_token>

{
    "posts": [{
        "title": "(Untitled)",
        "markdown": "",
        "status": "draft"
    }]
}

201 Created

{
    "posts": [{
        "id": 27,
        "uuid": "5f04e432-67e4-48be-a3b8-0a3beb3d5b0c",
        "title": "(Untitled)",
        "slug": "untitled-4",
        "markdown": "",
        "html": "",
        "image": null,
        "featured": false,
        "page": false,
        "status": "draft",
        "language": "en_US",
        "meta_title": null,
        "meta_description": null,
        "created_at": "2015-04-23T02:24:42.553Z",
        "created_by": 1,
        "updated_at": "2015-04-23T02:24:42.553Z",
        "updated_by": 1,
        "published_at": null,
        "published_by": null,
        "tags": [],
        "author": 1,
        "url": "/untitled-4/"
    }]
}

Test cases

  • [Online] New draft => back => new post should be at the top and have the status "Draft"
  • [Offline] New draft => back => new post should be at the top and have the status "Saved locally"
  • [Offline] New draft => back => another new post should be at the top and have the status "Saved locally"
  • [Offline] Open any previously-created offline draft => back => nothing should change
  • [Offline] Open any previously-created offline draft => save => back => nothing should change
  • [Online] Swipe to refresh => status of all local drafts should change to "Draft"
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant