remove extra api for changing theme

This commit is contained in:
lalitdeore12@gmail.com
2025-05-22 14:26:13 +05:30
parent 1eaad4e9be
commit 6264150592
2 changed files with 4 additions and 4 deletions
-1
View File
@@ -5103,7 +5103,6 @@ func initHandlers() {
r.HandleFunc("/api/v1/users/{key}/get2fa", shuffle.HandleGet2fa).Methods("GET", "OPTIONS")
r.HandleFunc("/api/v1/users/{key}/set2fa", shuffle.HandleSet2fa).Methods("POST", "OPTIONS")
r.HandleFunc("/api/v1/users", shuffle.HandleGetUsers).Methods("GET", "OPTIONS")
r.HandleFunc("/api/v1/users/{userid}/theme", shuffle.HandleSetUserTheme).Methods("POST", "OPTIONS")
// General - duplicates and old.
r.HandleFunc("/api/v1/getusers", shuffle.HandleGetUsers).Methods("GET", "OPTIONS")
+4 -3
View File
@@ -450,15 +450,16 @@ const LeftSideBar = ({ userdata, serverside, globalUrl, notifications, }) => {
};
const handleUpdateTheme = (newTheme) => {
const data = {
"user_id": userdata?.id,
"theme": newTheme,
}
const url = globalUrl + `/api/v1/users/${userdata?.id}/theme`;
const url = globalUrl + `/api/v1/users/updateuser`;
fetch(url, {
mode: "cors",
method: "POST",
method: "PUT",
body: JSON.stringify(data),
credentials: "include",
crossDomain: true,