We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Types
1 parent dc6a0c4 commit ee605dfCopy full SHA for ee605df
src/types/types.ts
@@ -12,10 +12,16 @@ export class Types {
12
endpointType: AllowedTypes;
13
query: string;
14
contextId?: string;
15
- }): Promise<{
16
- data: T | null;
17
- error: string | null;
18
- }> {
+ }): Promise<
+ | {
+ data: T;
+ error: null;
19
+ }
20
21
+ data: null;
22
+ error: string;
23
24
+ > {
25
const endpoint = `/types/${endpointType}`;
26
const payload = contextId
27
? { query: query, context_id: contextId }
@@ -26,7 +32,7 @@ export class Types {
32
body: payload,
33
});
28
34
29
- if (res.data?.data) return { data: res.data.data, error: null };
35
+ if (res.data) return { data: res.data.data, error: null };
30
36
31
37
return { data: null, error: res.error };
38
}
0 commit comments