discourse/spec/requests/api/schemas/json
Bianca Nenciu dcd81d56c0
FIX: category selectors for lazy loaded categories (#24533)
A lot of work has been put in the select kits used for selecting
categories: CategorySelector, CategoryChooser, CategoryDrop, however
they still do not work as expected when these selectors already have
values set, because the category were still looked up in the list of
categories stored on the client-side Categrories.list().

This PR fixes that by looking up the categories when the selector is
initialized. This required altering the /categories/find.json endpoint
to accept a list of IDs that need to be looked up. The API is called
using Category.asyncFindByIds on the client-side.

CategorySelector was also updated to receive a list of category IDs as
attribute, instead of the list of categories, because the list of
categories may have not been loaded.

During this development, I noticed that SiteCategorySerializer did not
serializer all fields (such as permission and notification_level)
which are not a property of category, but a property of the relationship
between users and categories. To make this more efficient, the
preload_user_fields! method was implemented that can be used to
preload these attributes for a user and a list of categories.
2023-12-08 12:01:08 +02:00
..
admin_user_list_response.json DEV: Deprecate defunct User#flag_level column (#24134) 2023-10-27 17:27:04 +08:00
admin_user_response.json DEV: Deprecate defunct User#flag_level column (#24134) 2023-10-27 17:27:04 +08:00
backups_create_request.json document api endpoints (#11958) 2021-02-03 17:12:35 -07:00
backups_list_response.json api docs example (#11997) 2021-02-08 10:09:44 -07:00
badge_create_request.json DEV: Document some of the badge api endpoints (#13919) 2021-08-03 06:25:12 -06:00
badge_create_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
badge_list_response.json DEV: Fix flaky admin badges.json api docs spec (#17210) 2022-06-23 14:32:17 -06:00
badge_update_request.json DEV: Document some of the badge api endpoints (#13919) 2021-08-03 06:25:12 -06:00
badge_update_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
category_create_request.json Fix structural problems with the openapi spec (#22256) 2023-06-23 11:06:45 -06:00
category_create_response.json FIX: category selectors for lazy loaded categories (#24533) 2023-12-08 12:01:08 +02:00
category_list_response.json FEATURE: Add dark mode option for category backgrounds (#24003) 2023-10-20 12:48:06 +00:00
category_topics_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
category_update_response.json FIX: category selectors for lazy loaded categories (#24533) 2023-12-08 12:01:08 +02:00
group_add_members_request.json document api endpoints (#11958) 2021-02-03 17:12:35 -07:00
group_add_members_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
group_create_request.json DEV: Document create group api params (#18736) 2022-10-24 18:55:51 -06:00
group_create_response.json FEATURE: Allow group owners promote more owners (#19768) 2023-01-11 16:43:18 +08:00
group_members_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
group_remove_members_request.json document api endpoints (#11958) 2021-02-03 17:12:35 -07:00
group_remove_members_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
group_response.json FEATURE: Allow group owners promote more owners (#19768) 2023-01-11 16:43:18 +08:00
groups_list_response.json FEATURE: Allow group owners promote more owners (#19768) 2023-01-11 16:43:18 +08:00
post_delete_request.json DEV: Document delete post API endpoint (#15495) 2022-01-07 16:09:32 -07:00
post_replies_response.json FEATURE: Allow expanding hidden posts for groups in SiteSetting.can_see_hidden_post (#21853) 2023-06-01 11:32:05 +08:00
post_show_response.json Fix structural problems with the openapi spec (#22256) 2023-06-23 11:06:45 -06:00
post_update_request.json DEV: Add fetching likes info to api docs (#21028) 2023-04-10 09:07:10 -06:00
post_update_response.json Fix structural problems with the openapi spec (#22256) 2023-06-23 11:06:45 -06:00
search_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
site_response.json FEATURE: Add dark mode option for category backgrounds (#24003) 2023-10-20 12:48:06 +00:00
success_ok_response.json document user endpoints (#11894) 2021-01-29 11:27:11 -07:00
tag_group_create_request.json
tag_group_create_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
topic_create_request.json DEV: Added a missing parameter to Discourse API Docs (#21085) 2023-04-24 15:44:09 +10:00
topic_create_response.json FEATURE: Allow expanding hidden posts for groups in SiteSetting.can_see_hidden_post (#21853) 2023-06-01 11:32:05 +08:00
topic_show_response.json FEATURE: Inline topic summary. Cached version accessible to everyone. (#22551) 2023-07-12 11:21:51 -03:00
upload_abort_multipart_request.json DEV: Add API docs for uploads and API doc watcher (#15387) 2021-12-23 08:40:15 +10:00
upload_batch_presign_multipart_parts_request.json DEV: Add API docs for uploads and API doc watcher (#15387) 2021-12-23 08:40:15 +10:00
upload_batch_presign_multipart_parts_response.json DEV: Add API docs for uploads and API doc watcher (#15387) 2021-12-23 08:40:15 +10:00
upload_complete_external_upload_request.json DEV: Add API docs for uploads and API doc watcher (#15387) 2021-12-23 08:40:15 +10:00
upload_complete_multipart_request.json DEV: Add API docs for uploads and API doc watcher (#15387) 2021-12-23 08:40:15 +10:00
upload_create_multipart_request.json DEV: Add API docs for uploads and API doc watcher (#15387) 2021-12-23 08:40:15 +10:00
upload_create_multipart_response.json DEV: Add API docs for uploads and API doc watcher (#15387) 2021-12-23 08:40:15 +10:00
upload_create_request.json
upload_create_response.json UX: Use dominant color as image loading placeholder (#18248) 2022-09-20 10:28:17 +01:00
upload_generate_presigned_put_request.json DEV: Add API docs for uploads and API doc watcher (#15387) 2021-12-23 08:40:15 +10:00
upload_generate_presigned_put_response.json DEV: Add S3 upload system specs using minio (#22975) 2023-08-23 11:18:33 +10:00
user_actions_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
user_anonymize_response.json DEV: Document anonymize user api endpoint (#13893) 2021-07-29 17:40:41 -06:00
user_badges_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
user_create_request.json DEV: Add description for active param on create user api docs (#18753) 2022-10-25 18:24:54 -06:00
user_create_response.json DEV: Refactor the api docs for the user endpoint (#14377) 2021-09-20 10:04:57 -06:00
user_delete_request.json document user endpoints (#11894) 2021-01-29 11:27:11 -07:00
user_delete_response.json document user endpoints (#11894) 2021-01-29 11:27:11 -07:00
user_emails_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
user_get_response.json FEATURE: Remove support for legacy navigation menu (#23752) 2023-10-09 07:24:10 +08:00
user_password_change_request.json document api endpoints (#11958) 2021-02-03 17:12:35 -07:00
user_password_reset_request.json document api endpoints (#11958) 2021-02-03 17:12:35 -07:00
user_password_reset_response.json document api endpoints (#11958) 2021-02-03 17:12:35 -07:00
user_refresh_gravatar_response.json document user endpoints (#11894) 2021-01-29 11:27:11 -07:00
user_silence_request.json FIX: Show suspended by user (#16927) 2022-06-01 14:54:23 +02:00
user_silence_response.json FIX: Show suspended by user (#16927) 2022-06-01 14:54:23 +02:00
user_suspend_request.json DEV: Document the user suspend api endpoint (#12179) 2021-02-23 05:58:22 -07:00
user_suspend_response.json FIX: Show suspended by user (#16927) 2022-06-01 14:54:23 +02:00
user_update_avatar_request.json document user endpoints (#11894) 2021-01-29 11:27:11 -07:00
user_update_email_request.json document user endpoints (#11894) 2021-01-29 11:27:11 -07:00
user_update_request.json DEV: Fix user update api docs (#23047) 2023-08-09 16:56:10 -06:00
user_update_response.json FEATURE: API to create user's associated account (#15737) 2022-03-03 18:17:02 +02:00
user_update_username_request.json DEV: Update api docs to update username and to get post replies (#15881) 2022-02-09 15:04:36 -07:00
users_public_list_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00