mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
Adds a WarpDrive store (`service:warp-store`, LegacyMode + JSON:API cache) alongside the existing `service:store`, routing requests through Discourse's `ajax()` helper. `RestCompatModel` bridges legacy `RestModel` callsites (`get`/`set`/`setProperties`, `store.createRecord`, `save`, `destroyRecord`) onto it. Converts **badge, user-badge, topic-details, bookmark, tag, tag-group, tag-info, tag-notification, tag-settings and archetype**, with per-model schemas, request builders and payload normalizers. Attributes outside a schema (plugin `add_to_serializer` fields, ad-hoc `create` keys) are retained separately so nothing the server sends is dropped.
26 lines
675 B
JavaScript
26 lines
675 B
JavaScript
// RPC-style endpoints; not CRUD, so they bypass `helpers.js`.
|
|
|
|
export function updateTopicNotificationLevel(topicId, level) {
|
|
return {
|
|
url: `/t/${encodeURIComponent(topicId)}/notifications`,
|
|
method: "POST",
|
|
options: { body: { notification_level: level } },
|
|
};
|
|
}
|
|
|
|
export function removeAllowedTopicGroup(topicId, name) {
|
|
return {
|
|
url: `/t/${encodeURIComponent(topicId)}/remove-allowed-group`,
|
|
method: "PUT",
|
|
options: { body: { name } },
|
|
};
|
|
}
|
|
|
|
export function removeAllowedTopicUser(topicId, username) {
|
|
return {
|
|
url: `/t/${encodeURIComponent(topicId)}/remove-allowed-user`,
|
|
method: "PUT",
|
|
options: { body: { username } },
|
|
};
|
|
}
|