-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Lines 23 to 28 in e9ebc55
function createExample(example) { | |
return db | |
.query( | |
"INSERT INTO examples(owner_id, language, title, example) VALUES($1, $2, $3, $4) RETURNING id", | |
[example.user_id, example.language, example.title, example.example] | |
) |
It's usually a good idea to return the newly created resource from a POST request. That way a client app can show the user exactly what new thing was created. Returning the ID is good, but it means the app has to make another network request to get the rest of the properties, which is slow/inefficient.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request