-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorval.config.ts
More file actions
66 lines (65 loc) · 1.91 KB
/
orval.config.ts
File metadata and controls
66 lines (65 loc) · 1.91 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// orval.config.ts
import { defineConfig } from 'orval'
export default defineConfig({
reportSystem: {
input: {
target: process.env.API_DOCS_URL ?? 'http://localhost:8080/v3/api-docs',
},
output: {
target: 'src/api/endpoints',
schemas: 'src/api/models',
client: 'react-query',
mode: 'tags-split',
override: {
mutator: {
path: 'src/utils/http/clients/coreBackend.client.ts',
name: 'coreBackendClient',
},
query: {
useQuery: true,
useMutation: true,
},
// ── Fix GET endpoints that were generated as mutations ──
operations: {
getReports: {
query: { useQuery: true, useMutation: false },
},
getProfile: {
query: { useQuery: true, useMutation: false },
},
getDashboardCounts: {
query: { useQuery: true, useMutation: false },
},
getImage: {
query: { useQuery: true, useMutation: false },
},
getUserImage: {
query: { useQuery: true, useMutation: false },
},
// ── Fix POST endpoints that should be mutations ──
moderateReport: {
query: { useQuery: false, useMutation: true },
},
createReport: {
query: { useQuery: false, useMutation: true },
},
logoutAuth: {
query: { useQuery: false, useMutation: true },
},
updateProfile: {
query: { useQuery: false, useMutation: true },
},
uploadProfileImage: {
query: { useQuery: false, useMutation: true },
},
uploadCoverImage: {
query: { useQuery: false, useMutation: true },
},
updatePost: {
query: { useQuery: false, useMutation: true },
},
},
},
},
},
})