Files
discourse/frontend/discourse/app/data/builders/topic-details.js
T
Jarek Radosz a6e133ceab DEV: Introduce warpdrive store (with compat layer) and migrate some models (#42147)
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.
2026-09-03 08:57:28 +02:00

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 } },
};
}