plone / guillotina

Python AsyncIO data API to manage billions of resources
https://guillotina.readthedocs.io/en/latest/
Other
187 stars 50 forks source link

Set id/name of group to ease the access later via id/name #1156

Closed ksuess closed 2 years ago

ksuess commented 2 years ago

POST /db/todo/groups HTTP/1.1 Accept: application/json Authorization: Basic cm9vdDpyb290 Content-Type: application/json Host: localhost:8080

{ "@type": "Group", "name": "todo_viewer" }

leads to a generated id/name

Set also title

codecov-commenter commented 2 years ago

Codecov Report

Merging #1156 (c6c048d) into master (86d0b29) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1156   +/-   ##
======================================
  Coverage    94.6%   94.6%           
======================================
  Files         383     383           
  Lines       32775   32775           
======================================
  Hits        30995   30995           
  Misses       1780    1780           
nilbacardit26 commented 2 years ago

Hi @ksuess, thank you for the PR, we appreciate that!

You need to change as well the next lines:

HTTP/1.1 201 Created
    Content-Type: application/json
    Location: http://localhost:8080/db/todo/groups/14f624ef23094362961df0e083cd77e4

by:

HTTP/1.1 201 Created
    Content-Type: application/json
    Location: http://localhost:8080/db/todo/groups/todo_viewer

same with:

"@id": "http://localhost:8080/db/todo/groups/14f624ef23094362961df0e083cd77e4"

Just change the id: 14f624ef23094362961df0e083cd77e4 by the one you created: todo_viewer

bloodbare commented 2 years ago

Could you rebase to master, there was a problem on black