You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't know how difficult this is, but creating an alias for certain endpoints could be a useful core feature. As example:
Lets say we have endpoints for pages or custom products-records. Instead of requesting /pages/123 or /products/987, it would be useful if e.g. the slug attribute of the records could be used as alias for ID.
Reason: currently, if a front-end wants to use SEO friendly URLs like /show/demo-item, it has to query for all products, loop through the result array, find the record matching demo-item, get the corresponding ID and request the API again to get the product details (the mapping happens on front-end side).
Maybe a TypeConverter can be used (see here and here) or the ID field can be selected with a condition:
IF {alias} is not empty THAN query by {alias} == {id}
ELSE query by uid == {id} (current implementation)
This discussion was converted from issue #23 on March 29, 2021 09:56.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Don't know how difficult this is, but creating an alias for certain endpoints could be a useful core feature. As example:
Lets say we have endpoints for pages or custom products-records. Instead of requesting
/pages/123
or/products/987
, it would be useful if e.g. theslug
attribute of the records could be used as alias for ID.Reason: currently, if a front-end wants to use SEO friendly URLs like
/show/demo-item
, it has to query for all products, loop through the result array, find the record matchingdemo-item
, get the corresponding ID and request the API again to get the product details (the mapping happens on front-end side).Maybe a TypeConverter can be used (see here and here) or the ID field can be selected with a condition:
Not sure if a REST API should be made for such things in general, please see it only as suggestion, discussion welcomed :)
Beta Was this translation helpful? Give feedback.
All reactions