-
Notifications
You must be signed in to change notification settings - Fork 300
Expand file tree
/
Copy pathconfig.js
More file actions
28 lines (25 loc) · 693 Bytes
/
config.js
File metadata and controls
28 lines (25 loc) · 693 Bytes
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
import apiClient from './client'
export const configApi = {
// Get configuration via MCP
async getConfig() {
// This will be proxied through a backend endpoint
const response = await apiClient.get('/admin/config')
return response
},
// Update configuration via MCP
async updateConfig(key, value) {
const response = await apiClient.post('/admin/config', {
action: 'set',
key,
value: typeof value === 'string' ? value : JSON.stringify(value)
})
return response
},
// Get single config value
async getConfigValue(key) {
const response = await apiClient.get('/admin/config', {
params: { key }
})
return response
}
}