MM-56819: Introduce --local mode in MMCTL to handle user preferences. (#26972)

Этот коммит содержится в:
Kunal Acharya
2024-09-09 17:42:22 +05:30
коммит произвёл GitHub
родитель 388dfdfbca
Коммит 0c3c298253
3 изменённых файлов: 72 добавлений и 0 удалений

12
server/channels/api4/preference_local.go Обычный файл
Просмотреть файл

@@ -0,0 +1,12 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package api4
func (api *API) InitPreferenceLocal() {
api.BaseRoutes.Preferences.Handle("", api.APILocal(getPreferences)).Methods("GET")
api.BaseRoutes.Preferences.Handle("", api.APILocal(updatePreferences)).Methods("PUT")
api.BaseRoutes.Preferences.Handle("/delete", api.APILocal(deletePreferences)).Methods("POST")
api.BaseRoutes.Preferences.Handle("/{category:[A-Za-z0-9_]+}", api.APILocal(getPreferencesByCategory)).Methods("GET")
api.BaseRoutes.Preferences.Handle("/{category:[A-Za-z0-9_]+}/name/{preference_name:[A-Za-z0-9_]+}", api.APILocal(getPreferenceByCategoryAndName)).Methods("GET")
}