Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 1x 1x 3x 3x 3x 1x 1x 1x 1x | import axios from "axios";
import { API_ENDPOINTS } from "@/api/endpoints";
export class StudentThemesAPI {
async getCurrentTheme() {
const response = await axios.get(API_ENDPOINTS.student.account.theme.fetch);
return response;
}
async applyTheme(themeData) {
// themeData can be either a string (backward compatibility) or an object with theme_id and color_mode
const payload = typeof themeData === "string" ? { theme_id: themeData } : themeData;
const response = await axios.post(API_ENDPOINTS.student.account.theme.apply, payload);
return response;
}
async updateTheme(themeUpdate) {
const response = await axios.put(API_ENDPOINTS.student.account.theme.update, themeUpdate);
return response;
}
async deleteTheme() {
const response = await axios.delete(API_ENDPOINTS.student.account.theme.delete);
return response;
}
}
|