]>
Commit | Line | Data |
---|---|---|
fd206f0b C |
1 | import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../' |
2 | import { CustomConfig } from '../../../../shared/models/config/custom-config.model' | |
0e1dc3e7 C |
3 | |
4 | function getConfig (url: string) { | |
5 | const path = '/api/v1/config' | |
6 | ||
36f9424f C |
7 | return makeGetRequest({ |
8 | url, | |
9 | path, | |
10 | statusCodeExpected: 200 | |
11 | }) | |
12 | } | |
13 | ||
14 | function getAbout (url: string) { | |
15 | const path = '/api/v1/config/about' | |
16 | ||
17 | return makeGetRequest({ | |
18 | url, | |
19 | path, | |
20 | statusCodeExpected: 200 | |
21 | }) | |
0e1dc3e7 C |
22 | } |
23 | ||
fd206f0b C |
24 | function getCustomConfig (url: string, token: string, statusCodeExpected = 200) { |
25 | const path = '/api/v1/config/custom' | |
26 | ||
27 | return makeGetRequest({ | |
28 | url, | |
29 | token, | |
30 | path, | |
31 | statusCodeExpected | |
32 | }) | |
33 | } | |
34 | ||
35 | function updateCustomConfig (url: string, token: string, newCustomConfig: CustomConfig, statusCodeExpected = 200) { | |
36 | const path = '/api/v1/config/custom' | |
37 | ||
38 | return makePutBodyRequest({ | |
39 | url, | |
40 | token, | |
41 | path, | |
42 | fields: newCustomConfig, | |
43 | statusCodeExpected | |
44 | }) | |
45 | } | |
46 | ||
47 | function deleteCustomConfig (url: string, token: string, statusCodeExpected = 200) { | |
48 | const path = '/api/v1/config/custom' | |
49 | ||
50 | return makeDeleteRequest({ | |
51 | url, | |
52 | token, | |
53 | path, | |
54 | statusCodeExpected | |
55 | }) | |
56 | } | |
57 | ||
0e1dc3e7 C |
58 | // --------------------------------------------------------------------------- |
59 | ||
60 | export { | |
fd206f0b C |
61 | getConfig, |
62 | getCustomConfig, | |
63 | updateCustomConfig, | |
36f9424f | 64 | getAbout, |
fd206f0b | 65 | deleteCustomConfig |
0e1dc3e7 | 66 | } |