Update and create with ids or objects #90

Closed
opened 2021-01-12 16:04:29 +00:00 by niggl · 1 comment
Owner

Motivation

Right now most create and update actions that include other entities/relations require to provide the user to provide that entity's id.
To increase UX all create and update actions should accept plain numbers (or arrays of numers) and a custom class containing an id.

Examples

Example 1: Numbers only

When creating a new track scan you have to provide the card's and station's ids as plain numbers.

{
    "card": 1,
    "station": 4
}

Example 2: Class only

When updateing a user you have to provide it's groups as an array containing objects that have the groups' ids as the property "id".

{
    "id": 6,
    "enabled": true,
    "firstname": "demo_refresh",
    "middlename": "demo_refresh",
    "lastname": "demo_refresh",
    "username": "demo_refresh",
    "profilePic": "https://dev.lauf-fuer-kaya.de/lfk-logo.png",
    "groups": [{"id":1}]
}
# Motivation Right now most create and update actions that include other entities/relations require to provide the user to provide that entity's id. To increase UX all create and update actions should accept plain numbers (or arrays of numers) and a custom class containing an id. # Examples ## Example 1: Numbers only When creating a new track scan you have to provide the card's and station's ids as plain numbers. ```json { "card": 1, "station": 4 } ``` ## Example 2: Class only When updateing a user you have to provide it's groups as an array containing objects that have the groups' ids as the property "id". ``` { "id": 6, "enabled": true, "firstname": "demo_refresh", "middlename": "demo_refresh", "lastname": "demo_refresh", "username": "demo_refresh", "profilePic": "https://dev.lauf-fuer-kaya.de/lfk-logo.png", "groups": [{"id":1}] } ```
niggl added this to the Project Quality of Life/Dev milestone 2021-01-12 16:04:29 +00:00
niggl added the
priority:low
enhancement
labels 2021-01-12 16:04:29 +00:00
niggl added a new dependency 2021-01-12 16:47:28 +00:00
Author
Owner

Due to limitations with jsonschema generation we'll just switch all endpoints to accepting numbers/number arrays of the relation's object's id

Due to limitations with jsonschema generation we'll just switch all endpoints to accepting numbers/number arrays of the relation's object's id
niggl added the
status:doing
label 2021-01-15 17:10:21 +00:00
niggl referenced this issue from a commit 2021-01-15 17:10:57 +00:00
niggl referenced this issue from a commit 2021-01-15 17:12:58 +00:00
niggl referenced this issue from a commit 2021-01-15 17:19:37 +00:00
niggl referenced this issue from a commit 2021-01-15 17:22:29 +00:00
niggl referenced this issue from a commit 2021-01-15 17:23:33 +00:00
niggl referenced this issue from a commit 2021-01-15 17:25:50 +00:00
niggl referenced this issue from a commit 2021-01-15 17:29:06 +00:00
niggl referenced this issue from a commit 2021-01-15 17:32:43 +00:00
niggl referenced this issue from a commit 2021-01-15 17:39:06 +00:00
niggl closed this issue 2021-01-15 17:57:47 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Depends on
#66 Donation API
lfk/backend
Reference: lfk/backend#90
No description provided.